Skip to content

chore(deps): update node.js to v22 #6243

chore(deps): update node.js to v22

chore(deps): update node.js to v22 #6243

Workflow file for this run

name: test
# Actions for any push (PR) onto (into) to master
# -----------------
# Control variables (GitHub Secrets)
# -----------------
#
# At the GitHub 'organisation' or 'project' level you must have the following
# GitHub 'Repository Secrets' defined (i.e. via 'Settings -> Secrets'): -
#
# AUTH0_CLIENT_ID
# AUTH0_CLIENT_SECRET
# DMIT_USER_A_PASSWORD
# DMIT_USER_A_PASSWORD
#
# -----------
# Environment (GitHub Environments)
# -----------
#
# Environment (n/a)
on:
push:
jobs:
# check that both APIs are responding normally before running tests
check-api:
runs-on: ubuntu-latest
steps:
- name: Get DM Version
run: |
curl -f -X 'GET' \
'https://data-manager-test.xchem-dev.diamond.ac.uk/data-manager-api/version' \
-H 'accept: application/json'
- name: Get AS Version
run: |
curl -f -X 'GET' \
'https://account-server-test.xchem-dev.diamond.ac.uk/account-server-api/version' \
-H 'accept: application/json'
test-base-path:
needs: check-api # tests are skipped if APIs are down to avoid false negatives
# Setup
runs-on: ubuntu-latest
environment: data-manager-ui/test
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: pnpm/[email protected]
with:
version: 8.15.4
run_install: false
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- run: node -v
- name: Setup Playwright
run: pnpm exec playwright install --with-deps
- name: Load cached build for speed
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
# Test WITH base path set
- name: Build with base path
run: pnpm build
env:
BASE_PATH: "/data-manager-ui"
# Ok for tests/dev but we don't do this on prod. This is to prevent some flakely tests from causing problems
- name: Disable strict SSL
run: npm config set strict-ssl=false
# Manually add a "test concurrency"
# This ensures only one test job runs at a time (across all workflows)
# If this workflow is billed by the elapsed time, this will add a lot to this cost
- name: Turnstyle
uses: softprops/turnstyle@v1
with:
abort-after-seconds: 600
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test with base path
env:
AUTH0_CLIENT_ID: "${{ secrets.AUTH0_CLIENT_ID }}"
AUTH0_CLIENT_SECRET: "${{ secrets.AUTH0_CLIENT_SECRET }}"
DMIT_USER_A_PASSWORD: "${{ secrets.DMIT_USER_A_PASSWORD }}"
AUTH0_SECRET: "LONG_RANDOM_VALUE"
BASE_URL: "http://localhost:3000"
BASE_PATH: "/data-manager-ui"
DONT_USE_STANDALONE_OUTPUT: true
DANGEROUS__DISABLE_SSL_CERT_CHECK_IN_API_PROXY: 1
DATA_MANAGER_API_SERVER: "https://data-manager-test.xchem-dev.diamond.ac.uk/data-manager-api"
ACCOUNT_SERVER_API_SERVER: "https://account-server-test.xchem-dev.diamond.ac.uk/account-server-api"
KEYCLOAK_URL: "https://keycloak-test.xchem-dev.diamond.ac.uk/auth/realms/squonk"
PW_USERNAME: "dmit-user-a"
PW_PASSWORD: "${{ secrets.DMIT_USER_A_PASSWORD }}"
TEST_PORT: 3000
run: pnpm test:ci
- name: Upload results for bath path
if: always()
uses: actions/upload-artifact@v4
with:
name: Base Path Results
path: test-results
test-no-base-path:
needs: check-api # tests are skipped if APIs are down to avoid false negatives
# Setup
runs-on: ubuntu-latest
environment: data-manager-ui/test
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: pnpm/[email protected]
with:
version: 8.15.4
run_install: false
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- run: node -v
- name: Setup Playwright
run: pnpm exec playwright install --with-deps
- name: Load cached build for speed
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
# Test withOUT base path set
- name: Build without base path
run: pnpm build
env:
BASE_PATH: ""
# Ok for tests/dev but we don't do this on prod. This is to prevent some flakely tests from causing problems
- name: Disable strict SSL
run: npm config set strict-ssl=false
- name: Turnstyle
uses: softprops/turnstyle@v1
with:
abort-after-seconds: 600
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test without base path
env:
AUTH0_CLIENT_ID: "${{ secrets.AUTH0_CLIENT_ID }}"
AUTH0_CLIENT_SECRET: "${{ secrets.AUTH0_CLIENT_SECRET }}"
DMIT_USER_A_PASSWORD: "${{ secrets.DMIT_USER_A_PASSWORD }}"
AUTH0_SECRET: "LONG_RANDOM_VALUE"
BASE_URL: "http://localhost:3000"
DONT_USE_STANDALONE_OUTPUT: true
DANGEROUS__DISABLE_SSL_CERT_CHECK_IN_API_PROXY: 1
BASE_PATH: ""
DATA_MANAGER_API_SERVER: "https://data-manager-test.xchem-dev.diamond.ac.uk/data-manager-api"
ACCOUNT_SERVER_API_SERVER: "https://account-server-test.xchem-dev.diamond.ac.uk/account-server-api"
KEYCLOAK_URL: "https://keycloak-test.xchem-dev.diamond.ac.uk/auth/realms/squonk"
PW_USERNAME: "dmit-user-a"
PW_PASSWORD: "${{ secrets.DMIT_USER_A_PASSWORD }}"
TEST_PORT: 3000
run: pnpm test:ci
- name: Upload results for no bath path
if: always()
uses: actions/upload-artifact@v4
with:
name: No Base Path Results
path: test-results