Skip to content

ci: pin rman to 2.0.0-beta.5, and name the right repository #2

ci: pin rman to 2.0.0-beta.5, and name the right repository

ci: pin rman to 2.0.0-beta.5, and name the right repository #2

Workflow file for this run

name: Test
on:
# Can be called from other workflows
workflow_call:
# Can be run manually
workflow_dispatch:
# on git push
push:
branches:
- dev
paths:
# This file itself: a change to how the tests run is a reason to run them. Without it the
# workflow could only be exercised by changing something else at the same time.
- '.github/workflows/test.yml'
- 'packages/*/src/**'
- 'packages/*/test/**'
- 'packages/*/*.{json,js,mjs,cjs}'
- 'support/test/**'
- '.mocharc.cjs'
- 'package.json'
- 'tsconfig*.json'
# Only one run per branch at a time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
if: >
github.event_name == 'workflow_dispatch' ||
(
github.event_name == 'push' &&
!(
contains(github.event.head_commit.message, 'no-test') ||
(
startsWith(github.event.head_commit.message, 'Merge pull request') &&
contains(github.event.head_commit.message, '/dev')
)
)
)
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
# Checks out as well, so there is no separate actions/checkout step.
#
# `panates/ghac-setup-node` was the old name of this same repository - GitHub still redirects
# it, which is why it kept working, but the current name is what should be written down.
#
# `rman-version` replaces the `npm install rman -g` step this used to have: that installed
# whatever `latest` happened to be, so the day rman 2.0.0 reached `latest` this job would have
# jumped a major without anything here changing.
- name: 'Setup Environment'
uses: panates/gh-setup-node@v2
with:
node-version: '20.19.2'
# **An exact version, and only until rman 2.0.0 ships.** `rman@2` does not resolve: npm's
# dist-tags are `latest: 2.0.0-beta.3` and `beta: 2.0.0-beta.5`, and a bare `2` range does
# not match a prerelease - `npm view rman@2` answers `No match found for version 2`, and
# `npm i -g rman@2` fails the same way. Put `'2'` back once 2.0.0 is published.
rman-version: '2.0.0-beta.5'
# **`npm run qc`, not `rman run qc`.** Under rman 2 the monorepo root's own script no longer
# counts toward the script being defined - the root contributes only pre/post bookends - so
# `rman run qc` fails with `No package defines a "qc" script.` (measured, exit 1), since `qc`
# is declared in the root package.json alone. npm runs that root script, which is itself
# `rman run lint`, and `lint` *is* declared by the packages.
- name: Run qc tests
run: npm run qc