Skip to content

Upgrade Rust, update Python lockfile and fix CI #6

Upgrade Rust, update Python lockfile and fix CI

Upgrade Rust, update Python lockfile and fix CI #6

Workflow file for this run

name: Node JS CI
on:
push:
branches:
- master
- 'auto-updates/**'
pull_request: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
check_for_changes:
name: Check JS Changes
runs-on: ubuntu-24.04
outputs:
js_changes: ${{ steps.changed-files.outputs.any_modified }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
lfs: false
- name: Get changed files
id: changed-files
# tj-actions/changed-files - pinned it a git hash for maximum safety, managed by dependabot
uses: tj-actions/changed-files@f7a56405a89ea095c6230f10e7f1c49daab13b35
with:
files: |
src/node/**
.github/**
nodes_js_ci:
name: Node/JS CI
runs-on: ubuntu-24.04
needs: check_for_changes
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
with:
lfs: false
- name: Use Node.js
uses: actions/setup-node@v3
if: needs.check_for_changes.outputs.js_changes == 'true'
with:
node-version-file: 'src/node/.nvmrc'
cache: 'yarn'
cache-dependency-path: src/node/yarn.lock
- name: Cache node_modules
uses: actions/cache@v3
if: needs.check_for_changes.outputs.js_changes == 'true'
with:
key: node-js-yarn-cache-v1-${{ runner.os }}-${{ hashFiles('src/node/yarn.lock') }}
path: |
'src/node/node_modules/'
'src/node/toolchain/frontend/node_modules/'
'src/node/toolchain/pants-demo-site/node_modules/'
- name: Install dependencies
if: needs.check_for_changes.outputs.js_changes == 'true'
working-directory: src/node
run: |
yarn install --dev
# Emit the versions so we know what things ran against.
echo "Node version: $(node --version)"
echo "Yarn version: $(yarn --version)"
echo "Yarn cache dir: $(yarn cache dir)"
yarn check --integrity
- name: Lint Frontend SPA
if: needs.check_for_changes.outputs.js_changes == 'true'
working-directory: src/node/toolchain/frontend
run: yarn lint && yarn prettier-check
- name: Lint Pants demo site SPA
if: needs.check_for_changes.outputs.js_changes == 'true'
working-directory: src/node/toolchain/pants-demo-site
run: yarn lint && yarn prettier-check
- name: Test Frontend SPA
if: needs.check_for_changes.outputs.js_changes == 'true'
working-directory: src/node/toolchain/frontend
env:
NODE_OPTIONS: --max_old_space_size=6144
run: yarn test-ci
- name: Upload Frontend SPA tests coverage
uses: codecov/codecov-action@v3.1.0
if: needs.check_for_changes.outputs.js_changes == 'true'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: dist/node_coverage/frontend/clover.xml
flags: node,frontend
name: spa_js_upload
- name: Test Pants demo site SPA
if: needs.check_for_changes.outputs.js_changes == 'true'
working-directory: src/node/toolchain/pants-demo-site
run: yarn test-ci
- name: Upload Pants demo site SPA tests coverage
uses: codecov/codecov-action@v3.1.0
if: needs.check_for_changes.outputs.js_changes == 'true'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: src/node/toolchain/pants-demo-site/coverage/clover.xml
flags: node,demosite
name: demosite_js_upload
- name: Bundle Toolchain frontend SPA
if: needs.check_for_changes.outputs.js_changes == 'true'
working-directory: src/node/toolchain/frontend
run: yarn build
- name: Bundle Pants demo site SPA
if: needs.check_for_changes.outputs.js_changes == 'true'
working-directory: src/node/toolchain/pants-demo-site
run: yarn build
cypress-run:
name: Cypress tests
runs-on: ubuntu-24.04
needs: check_for_changes
if: needs.check_for_changes.outputs.js_changes == 'true'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
cache: 'yarn'
cache-dependency-path: src/node/yarn.lock
node-version-file: 'src/node/toolchain/pants-demo-site/.nvmrc'
# Install NPM dependencies, cache them correctly
# and run all Cypress tests
- name: Cypress run
uses: cypress-io/github-action@v5
with:
working-directory: src/node/toolchain/pants-demo-site
browser: chrome
start: yarn run start
wait-on: 'http://localhost:3000'
command: yarn run cypress run