-
-
Notifications
You must be signed in to change notification settings - Fork 6
75 lines (71 loc) · 1.82 KB
/
functional-tests.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
74
75
---
name: Functional Tests
on: # yamllint disable-line rule:truthy
push:
branches:
- main
pull_request:
paths:
- .github/workflows/functional-tests.yml
- src/**
- action.yml
schedule:
# Every Friday at 09:00 JST
- cron: "0 0 * * 5"
workflow_dispatch: {}
defaults:
run:
shell: sh
jobs:
run-script:
name: Run script
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
version: ["3.2", "3.1.2", "3.1.1"]
runs-on: ubuntu-latest
steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4
- name: Setup COBOL
uses: ./
with:
version: ${{ matrix.version }}
- name: Validate script
run: |
cobc -x ./HelloWorld.cob
[ "$(./HelloWorld)" = "Hello World!" ] || exit 1;
test-force:
name: Test force
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
force: ["true", "false"]
steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4
- name: Setup COBOL 1
id: setup-cobol-1
uses: ./
- name: Setup COBOL 2
id: setup-cobol-2
uses: ./
with:
force: ${{ matrix.force }}
- name: Test action completion
run: |
test_equal() {
if [ "${2}" != "${3}" ]; then
echo "::error title=${1}::Expected: ${3}. Actual: ${2}."
exit 1
fi
}
test_equal "Wrong \"installed\" output from setup-cobol-1" \
"${{ steps.setup-cobol-1.outputs.installed }}" \
"true"
test_equal "Wrong \"installed\" output from setup-cobol-2" \
"${{ steps.setup-cobol-2.outputs.installed }}" \
"${{ matrix.force }}"