Skip to content

2.42.0

2.42.0 #4501

Workflow file for this run

name: CI
on: push
jobs:
build:
runs-on: ubuntu-latest
env:
COOKIE_SECRET: somethingverysecrethere
GOOGLE_ANALYTICS_PROPERTY_ID: ga-test
NOTIFY_CALLBACK_TOKEN: some-token
ENABLE_SYSTEM_LICENCE_VIEW: true
steps:
# Downloads a copy of the code in your repository before running CI tests
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of SonarQube analysis
# Before we do anything, check we haven't accidentally left any `experiment.only()` or `test.only(` statements in
# the tests
#
# Reworking of https://stackoverflow.com/a/21788642/6117745
- name: Temporary tag check
run: |
! grep -R 'experiment.only(\|test.only(' test
- name: Install Node
uses: actions/setup-node@v4
with:
node-version-file: ".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
- name: Run unit tests
run: |
npm test
- name: Analyze with SonarQube
if: github.actor != 'dependabot[bot]'
uses: sonarsource/sonarqube-scan-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This is provided automatically by GitHub
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # This needs to be set in your repo; settings -> secrets