The shop's CI is one job: lint, then test. Split it, and both run at the same time, so the run finishes sooner: jobs start together unless you tell one to wait, which is the next lesson.
Each job runs on its own fresh machine. Nothing carries over from another job, not even the code: every job checks it out.
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- run: shellcheck *.sh
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- run: ./test.shIf any job fails, the run fails.
Now a build job for the catalogue. A step of several lines uses run: |: every indented line under it is one command, run in order.
- name: Build
run: |
mkdir -p dist
./build.sh > dist/catalogue.txt
cat dist/catalogue.txtObjectives
- Lint and test as two jobs.
- Build the catalogue.