Bump docker/build-push-action from 5 to 6 (#73) #274
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: CI | |
on: push | |
jobs: | |
build: | |
# You must use a Linux environment when using service containers or container jobs | |
runs-on: ubuntu-latest | |
steps: | |
# Downloads a copy of the code in your repository before running CI tests | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# Check for 'temporary' tags i.e. tags often used when working on a feature/scenario but which we don't want | |
# appearing in the final commit to main | |
# | |
# Reworking of https://stackoverflow.com/a/21788642/6117745 | |
- name: Temporary tag check | |
run: | | |
! grep -r --include="*.feature" "@wip\|@focus" cypress/integration/ | |
# Our projects use .nvmrc files to specify the node version to use. We can read and then output it as the result | |
# this step. Subsequent steps can then access the value | |
- name: Read Node version | |
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)" | |
# Give the step an ID to make it easier to refer to | |
id: nvm | |
# Gets the version to use by referring to the previous step | |
- name: Install Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "${{ steps.nvm.outputs.NVMRC }}" | |
# Speeds up workflows by reading the node modules from cache. Obviously you need to run it at least once, and the | |
# cache will be updated should the package-lock.json file change | |
- name: Cache Node modules | |
uses: actions/cache@v4 | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.OS }}-node- | |
${{ runner.OS }}- | |
# Performs a clean installation of all dependencies in the `package.json` file | |
# For more information, see https://docs.npmjs.com/cli/ci.html | |
- name: Install dependencies | |
run: npm ci | |
# Run linting first. No point running the tests if there is a linting issue | |
- name: Run lint check | |
run: | | |
npm run lint | |
# We don't have unit tests in this project. We also can't access the service as its hidden behind a VPN. Instead | |
# we run a special CI test to confirm we haven't broken being able to run the project | |
- name: Run unit tests | |
run: | | |
npm run cy:run:ci |