Update govuk-frontend to v5 (#197) #363
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: build | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
jobs: | |
tests: | |
name: tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Start Redis | |
uses: supercharge/redis-github-action@1.1.0 | |
with: | |
redis-version: 5 | |
- name: Checkout frontend | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Install node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: "20.x" | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: "11.0.9" | |
java-package: jdk | |
- name: Checkout API | |
uses: actions/checkout@v2 | |
with: | |
repository: DEFRA/rod-catch-returns-api | |
path: api | |
- name: Cache Maven packages | |
uses: actions/cache@v2 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Run api | |
working-directory: ./api | |
run: | | |
launches/serverctl -q start --spring.profiles.active=h2 | |
- name: Install dependencies | |
run: npm ci | |
- name: Run Tests | |
env: | |
COOKIE_PW: 532fdfghdf62645872aaau121qsqw112 | |
API_PATH: /api | |
API_HOSTNAME: localhost | |
API_PORT: 9580 | |
REDIS_HOSTNAME: localhost | |
REDIS_PORT: 6379 | |
SESSION_TTL_MS: 3600000 | |
API_REQUEST_TIMEOUT_MS: 20000 | |
CONTEXT: ANGLER | |
AUTH_PW: "1234567890123456" | |
CATCH_RETURNS_GOV_UK: https://www.gov.uk/catch-return | |
HTTPS: false | |
run: npm run test | |
- name: Fix lab code coverage paths | |
working-directory: ./coverage | |
run: | | |
sed -i 's/\/home\/runner\/work\/rod-catch-returns-frontend\/rod-catch-returns-frontend\//\/github\/workspace\//g' lcov.info | |
sed -i 's/\/home\/runner\/work\/rod-catch-returns-frontend\/rod-catch-returns-frontend\//\/github\/workspace\//g' coverage.html | |
- name: Fix jest code coverage paths | |
working-directory: ./coverage-jest | |
run: | | |
sed -i 's/\/home\/runner\/work\/rod-catch-returns-frontend\/rod-catch-returns-frontend\//\/github\/workspace\//g' lcov.info | |
- name: SonarCloud Scan | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
JAVA_HOME: | |
use_embedded_jre: true | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |