Set default version to 3.2 (#139) #158
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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 }}" |