| 1 |
# Workflow for testing multiple bash versions with Docker |
| 2 |
name: bash |
| 3 |
|
| 4 |
on: |
| 5 |
workflow_dispatch: |
| 6 |
pull_request: |
| 7 |
paths-ignore: |
| 8 |
- '.github/workflows/*.ya?ml' |
| 9 |
- '!.github/workflows/bash.yml' |
| 10 |
- 'cylc/flow/etc/syntax/**' |
| 11 |
- 'etc/syntax/**' |
| 12 |
- 'tests/unit/**' |
| 13 |
- 'tests/integration/**' |
| 14 |
- '**.md' |
| 15 |
- '**/README*/**' |
| 16 |
push: |
| 17 |
branches: |
| 18 |
- master |
| 19 |
- '8.*.x' |
| 20 |
paths-ignore: |
| 21 |
- '.github/workflows/*.ya?ml' |
| 22 |
- '!.github/workflows/bash.yml' |
| 23 |
- 'cylc/flow/etc/syntax/**' |
| 24 |
- 'etc/syntax/**' |
| 25 |
- 'tests/unit/**' |
| 26 |
- 'tests/integration/**' |
| 27 |
- '**.md' |
| 28 |
- '**/README*/**' |
| 29 |
|
| 30 |
concurrency: |
| 31 |
group: ${{ github.workflow }}-${{ github.ref }} |
| 32 |
cancel-in-progress: true |
| 33 |
|
| 34 |
defaults: |
| 35 |
run: |
| 36 |
shell: bash |
| 37 |
|
| 38 |
env: |
| 39 |
FORCE_COLOR: 2 |
| 40 |
PIP_PROGRESS_BAR: off |
| 41 |
|
| 42 |
jobs: |
| 43 |
bash-docker: |
| 44 |
runs-on: ubuntu-latest |
| 45 |
timeout-minutes: 15 |
| 46 |
strategy: |
| 47 |
fail-fast: false |
| 48 |
matrix: |
| 49 |
bash-version: |
| 50 |
- '3.2' |
| 51 |
- '4.2' |
| 52 |
# if you use a value like 5.0, YAML will round it to 5, which will cause an error later on |
| 53 |
- '5.0' |
| 54 |
env: |
| 55 |
IMAGE: 'ghcr.io/cylc/cylc-bash-testing-2:master' |
| 56 |
steps: |
| 57 |
- name: Checkout |
| 58 |
uses: actions/checkout@v5 |
| 59 |
|
| 60 |
- name: Run Docker container |
| 61 |
run: | |
| 62 |
docker pull "$IMAGE" |
| 63 |
docker run --name bash -v $(pwd -P):/root/cylc-flow --rm -t -d -m 1G --memory-swap 1G "$IMAGE" /bin/bash |
| 64 |
docker ps -a |
| 65 |
|
| 66 |
- name: Install Cylc dependencies in the container |
| 67 |
run: | |
| 68 |
docker exec -w /root/cylc-flow bash python3.12 -m pip install .[all] --break-system-packages |
| 69 |
|
| 70 |
- name: Set the container bash version |
| 71 |
run: docker exec bash update-alternatives --set bash /bash/bash-${{ matrix.bash-version }} |
| 72 |
|
| 73 |
- name: Run functional tests that validate or are related to how Cylc uses bash |
| 74 |
run: | |
| 75 |
docker exec -w /root/cylc-flow bash \ |
| 76 |
./etc/bin/run-functional-tests -v \ |
| 77 |
tests/functional/broadcast/00-simple.t \ |
| 78 |
tests/functional/cylc-poll/11-event-time.t \ |
| 79 |
tests/functional/cylc-poll/15-job-st-file-no-batch.t \ |
| 80 |
tests/functional/events/28-inactivity.t \ |
| 81 |
tests/functional/events/34-task-abort.t \ |
| 82 |
tests/functional/job-file-trap/00-sigusr1.t \ |
| 83 |
tests/functional/job-file-trap/02-pipefail.t \ |
| 84 |
tests/functional/job-file-trap/03-user-trap.t \ |
| 85 |
tests/functional/jobscript/00-torture.t \ |
| 86 |
tests/functional/pause-resume/12-pause-then-retry.t \ |
| 87 |
tests/functional/shutdown/09-now2.t \ |
| 88 |
tests/functional/shutdown/13-no-port-file-check.t \ |
| 89 |
tests/functional/shutdown/14-no-dir-check.t |
| 90 |
|
| 91 |
- name: Copy cylc-run out of container |
| 92 |
if: failure() |
| 93 |
run: | |
| 94 |
docker cp bash:/root/cylc-run . |
| 95 |
|
| 96 |
- name: Upload artifact |
| 97 |
if: failure() |
| 98 |
uses: actions/upload-artifact@v4 |
| 99 |
with: |
| 100 |
name: 'cylc-run (bash-${{ matrix.bash-version }})' |
| 101 |
path: cylc-run |
| 102 |
include-hidden-files: true |