-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add publishing workflow; update workflow, dependencies, tasks, docs (#…
…147) * Add publishing workflow * Always run linter * Use `npm ci` instead of `npm i` * Reformat YAML * Increase `INTEGRATION_TIMEOUT` to `20000` from `5000` * Remove outdated makefile items * Update to `eslint@^8.52` and `pa11y-lint-config@^3` * Replace the warning about Node.js 16, since it's passing in the workflow * Lower-case headings to match `pa11y/pa11y`, use backticks for config options * Update copyright date to 2023 * Apply agreed support policy; tighten up Node.js versions * Upgrade to `joi@~17.11` * Rename workflow from `checkout_and_test` to `test`, matching other repos * Shorten the matrix of Node.js versions * Improve the comments that remain * Upgrade to `cron@~2.4.4` * Point the build badge to GitHub Actions, replacing Travis * Consistently use single quotes * Require presence of test folders and remove generalised items * Settle on `make lint` throughout rather than the combination of `verify` and `lint` * Split testing in workflow; move unit tests before service boot * Embed vars since they're already documented, narrow headings * Exit with an error when webservice isn't running * Clarify relationship between tests and service in contribution section * Reorganise requirements and introduction's advice about options * Integrate regions discussing configuration and reorganise * Remove unused link definitions * Publish with minimum supported Node.js version (12) * Move MongoDB action adjacent to remainder of integration test setup to allow early failures * Fix copyright newline * Make requirements clearer * Fix tone in introduction after revision * Emphasise headless chrome config exclusivity * Link to config dir, be clearer about modes, separate scripts * Fix weird environment var section after revision * Shorten options descriptions * Link to fixtures * Fix link to list of configuration options * Use normal weight for requirements links * Make first line sound better * Improve introduction to `#configuration` * Change 'Pa11y 4` to `Pa11y Webservice 4` * Remove unused task `make all` * Remove make's install tasks since we use `npm install` and `npm ci` in the readme and CI
- Loading branch information
1 parent
eb1ae50
commit 59bf0f9
Showing
8 changed files
with
444 additions
and
636 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
on: | ||
release: | ||
types: [created, edited, published] | ||
workflow_dispatch: | ||
inputs: | ||
dryRun: | ||
description: 'Dry run only' | ||
required: true | ||
default: true | ||
type: boolean | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 12 | ||
registry-url: 'https://registry.npmjs.org' | ||
- run: npm ci | ||
|
||
- name: Publish package | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.REGISTRY_PUBLISH_TOKEN }} | ||
if: > | ||
(github.event_name == 'release' && github.event.action == 'published') || | ||
(github.event_name == 'workflow_dispatch' && !inputs.dryRun) | ||
run: npm publish | ||
|
||
- name: Publish package (dry run) | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.REGISTRY_PUBLISH_TOKEN }} | ||
if: > | ||
(github.event_name == 'release' && github.event.action != 'published') || | ||
(github.event_name == 'workflow_dispatch' && inputs.dryRun) | ||
run: npm publish --dry-run |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,32 @@ | ||
# This workflow will do a clean install of node dependencies, build the source code and run tests. | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | ||
|
||
name: Build and lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
checkout_and_test: | ||
test: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
include: | ||
- node-version: 12.x | ||
lint: true # Linter is run only once to shorten the total build time | ||
- node-version: 14.x | ||
- node-version: 16.x | ||
|
||
node-version: [12, 14, 16] | ||
steps: | ||
- name: Checkout code from ${{ github.repository }} | ||
uses: actions/checkout@v4 | ||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: MongoDB in GitHub Actions | ||
- run: npm ci | ||
- run: make lint | ||
- run: make test-unit | ||
|
||
- name: Supply MongoDB 3.4 | ||
uses: supercharge/[email protected] | ||
with: | ||
mongodb-version: 3.4 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Run linter | ||
if: ${{ matrix.lint }} | ||
run: make lint | ||
- name: Create test config | ||
mongodb-version: 3.4 | ||
- name: Supply integration test configuration file | ||
run: cp config/test.sample.json config/test.json | ||
- name: Start test app | ||
- name: Make webservice available to be integration-tested | ||
run: NODE_ENV=test node index.js & | ||
- run: sleep 10s | ||
- name: Run tests | ||
run: make test | ||
|
||
- run: make test-integration |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,6 @@ | ||
include Makefile.node | ||
|
||
|
||
# Verify tasks | ||
# ------------ | ||
|
||
# Lint alias for backwards compatibility | ||
lint: verify | ||
|
||
|
||
# Database tasks | ||
# -------------- | ||
|
||
# Add fixtures | ||
# Add fixtures to database | ||
fixtures: | ||
@node ./script/fixtures.js | ||
@$(TASK_DONE) |
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
Oops, something went wrong.