-
-
Notifications
You must be signed in to change notification settings - Fork 22
73 lines (63 loc) · 2.71 KB
/
test-windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# This workflow will do a clean install of the dependencies and run tests across different versions
#
# Replace <track> with the track name
# Replace <image-name> with an image to run the jobs on
# Replace <action to setup tooling> with a github action to setup tooling on the image
# Replace <install dependencies> with a cli command to install the dependencies
#
# Find Github Actions to setup tooling here:
# - https://github.com/actions/?q=setup&type=&language=
# - https://github.com/actions/starter-workflows/tree/main/ci
# - https://github.com/marketplace?type=actions&query=setup
#
# Requires scripts:
# - bin/test
name: COBOL / Test (Windows)
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
ci:
runs-on: windows-2022
steps:
- name: Checkout repository
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5
- name: Cache GnuCOBOL
id: cache-gnu-cobol
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: $HOME\gnucobol-3.2.zip
key: ${{ runner.os }}-gnu-cobol-3.2
- name: Download GnuCOBOL
if: steps.cache-gnu-cobol.outputs.cache-hit != 'true'
shell: pwsh
run: |
$requestOpts = @{
Headers = If ($env:GITHUB_TOKEN) { @{ Authorization = "Bearer ${env:GITHUB_TOKEN}" } } Else { @{ } }
MaximumRetryCount = 3
RetryIntervalSec = 1
}
Invoke-WebRequest -Uri 'https://www.arnoldtrembley.com/GC32-BDB-SP1-rename-7z-to-exe.7z' -OutFile $HOME\gnucobol-3.2.7z @requestOpts
- name: Extract GnuCOBOL
shell: pwsh
run: 7z x $HOME\gnucobol-3.2.7z -ognucobol -y
- name: Fetch CobolCheck
shell: pwsh
run: bin/fetch-cobolcheck.ps1
- name: Setup environment
shell: pwsh
run: |
ls ${env:GITHUB_WORKSPACE}
$gnucobolDir = Join-Path $env:GITHUB_WORKSPACE -ChildPath "cobol" | Join-Path -ChildPath "gnucobol"
$env:Path = "${gnucobolDir}\bin;${env:GITHUB_WORKSPACE}\bin;${env:Path}"
[System.Environment]::SetEnvironmentVariable('COB_CONFIG_DIR', "${gnucobolDir}\config")
[System.Environment]::SetEnvironmentVariable('COB_COPY_DIR', "${gnucobolDir}\copy")
[System.Environment]::SetEnvironmentVariable('COB_CFLAGS', "-I ${gnucobolDir}\include")
[System.Environment]::SetEnvironmentVariable('COB_LDFLAGS', "-L ${gnucobolDir}\lib")
[System.Environment]::SetEnvironmentVariable('COB_LIBRARY_PATH', "${gnucobolDir}\lib")
[System.Environment]::SetEnvironmentVariable('COB_LIBS', "${gnucobolDir}\bin\libcob-4.dll")
- name: Run tests for all exercises
shell: pwsh
run: bin/test.ps1