Skip to content

Bump docker/metadata-action from 4 to 5 (#69) #268

Bump docker/metadata-action from 4 to 5 (#69)

Bump docker/metadata-action from 4 to 5 (#69) #268

Workflow file for this run

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@v3
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@v3
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