Migrate to Node 20, clean up workflows (#2902)
Tests still appear to fail per #2898. Unfortunately, I need actions/runner#2347 to ignore the test failures properly - I need them to be warnings, not hard errors.
This commit is contained in:
parent
2b687a31ea
commit
1b0899b469
9 changed files with 101 additions and 145 deletions
21
.github/actions/setup/action.yml
vendored
Normal file
21
.github/actions/setup/action.yml
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
# In the future, I'd like to fold this into its own action under the Mithril.js
|
||||||
|
# org and include `actions/checkout` as well. It'd simplify maintenance a bit
|
||||||
|
# and I could reuse it across multiple repos.
|
||||||
|
name: Setup CI context
|
||||||
|
description: Sets up repo and Node context and installs packages
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
# See supported Node.js release schedule here:
|
||||||
|
# https://github.com/nodejs/Release
|
||||||
|
node-version:
|
||||||
|
default: 20
|
||||||
|
description: The Node version to use
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: ${{ inputs.node-version }}
|
||||||
|
- run: npm ci
|
||||||
|
shell: bash
|
||||||
27
.github/workflows/lint-docs.yml
vendored
27
.github/workflows/lint-docs.yml
vendored
|
|
@ -1,27 +0,0 @@
|
||||||
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
|
|
||||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
||||||
|
|
||||||
name: lint-docs
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ next ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ next ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint-docs:
|
|
||||||
# https://github.com/MithrilJS/mithril.js/issues/2898
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
|
||||||
- uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 20
|
|
||||||
cache: 'npm'
|
|
||||||
- run: npm ci
|
|
||||||
- run: npm run lint:docs
|
|
||||||
30
.github/workflows/lint-js.yml
vendored
30
.github/workflows/lint-js.yml
vendored
|
|
@ -1,30 +0,0 @@
|
||||||
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
|
|
||||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
||||||
|
|
||||||
name: lint-js
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ next ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ next ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint-js:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [18]
|
|
||||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: ${{ matrix.node-version }}
|
|
||||||
cache: 'npm'
|
|
||||||
- run: npm ci
|
|
||||||
- run: npm run lint:js
|
|
||||||
18
.github/workflows/merge.yml
vendored
18
.github/workflows/merge.yml
vendored
|
|
@ -10,25 +10,11 @@ concurrency: prr:deploy
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
merge:
|
merge:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [16.x]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- run: git clone --depth=0 https://github.com/MithrilJS/mithril.js.git && cd mithril.js
|
||||||
with:
|
- uses: ./.github/actions/setup
|
||||||
ref: 'next'
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: ${{ matrix.node-version }}
|
|
||||||
cache: 'npm'
|
|
||||||
- run: npm ci
|
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
- run: npx pr-release merge --target master --source next --commit --force --clean --changelog ./docs/recent-changes.md --compact --minimize-semver-change
|
- run: npx pr-release merge --target master --source next --commit --force --clean --changelog ./docs/recent-changes.md --compact --minimize-semver-change
|
||||||
env:
|
env:
|
||||||
|
|
|
||||||
22
.github/workflows/push-master.yml
vendored
22
.github/workflows/push-master.yml
vendored
|
|
@ -1,19 +1,17 @@
|
||||||
name: 'Push `master`'
|
name: Warn on pushing to `master`
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened]
|
types: [opened]
|
||||||
branches: ['master']
|
branches: [master]
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
jobs:
|
jobs:
|
||||||
comment:
|
comment:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/github-script@v3
|
- run: |
|
||||||
with:
|
gh issue comment ${{ github.event.pull_request.url }} \
|
||||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
--body '⚠⚠⚠ Hey @${{ github.actor }}, did you mean to open this against `next`? ⚠⚠⚠'
|
||||||
script: |
|
env:
|
||||||
await github.issues.createComment({
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
issue_number: context.issue.number,
|
name: Post alert comment
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
body: `⚠⚠⚠ Hey @${context.actor}, did you mean to open this against \`next\`? ⚠⚠⚠`
|
|
||||||
})
|
|
||||||
|
|
|
||||||
17
.github/workflows/rollback.yml
vendored
17
.github/workflows/rollback.yml
vendored
|
|
@ -7,24 +7,11 @@ concurrency: prr:deploy
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pr:
|
pr:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [16.x]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- run: git clone --depth=0 https://github.com/MithrilJS/mithril.js.git && cd mithril.js
|
||||||
with:
|
- uses: ./.github/actions/setup
|
||||||
ref: 'next'
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: ${{ matrix.node-version }}
|
|
||||||
cache: 'npm'
|
|
||||||
- run: npm ci
|
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
- run: npx pr-release rollback --verbose --target master --source next --verbose --ignore 'package*' --ignore docs/changelog.md --ignore docs/recent-changes.md
|
- run: npx pr-release rollback --verbose --target master --source next --verbose --ignore 'package*' --ignore docs/changelog.md --ignore docs/recent-changes.md
|
||||||
env:
|
env:
|
||||||
|
|
|
||||||
30
.github/workflows/test-js.yml
vendored
30
.github/workflows/test-js.yml
vendored
|
|
@ -1,30 +0,0 @@
|
||||||
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
|
|
||||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
||||||
|
|
||||||
name: test-js
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ next ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ next ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test-js:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [14, 16, 18]
|
|
||||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: ${{ matrix.node-version }}
|
|
||||||
cache: 'npm'
|
|
||||||
- run: npm ci
|
|
||||||
- run: npm run test:js
|
|
||||||
|
|
@ -1,30 +1,22 @@
|
||||||
name: pr
|
name: test-next-push
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ next ]
|
branches: [ next ]
|
||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency: prr:pre-release
|
concurrency: prr:pre-release
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pr:
|
build:
|
||||||
|
uses: ./.github/workflows/test.yml
|
||||||
|
|
||||||
|
publish-prerelease:
|
||||||
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [16.x]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- run: git clone --depth=0 https://github.com/MithrilJS/mithril.js.git && cd mithril.js
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
- uses: ./.github/actions/setup
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: ${{ matrix.node-version }}
|
|
||||||
cache: 'npm'
|
|
||||||
- run: npm ci
|
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
- run: npx pr-release pr --verbose --target master --source next --compact --verbose --minimize-semver-change
|
- run: npx pr-release pr --verbose --target master --source next --compact --verbose --minimize-semver-change
|
||||||
env:
|
env:
|
||||||
59
.github/workflows/test.yml
vendored
Normal file
59
.github/workflows/test.yml
vendored
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
name: test
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: [ next ]
|
||||||
|
workflow_dispatch:
|
||||||
|
workflow_call:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
actions: write
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
# This uses actions/checkout instead of `git clone` directly since it's way
|
||||||
|
# easier than parsing everything out.
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint-docs:
|
||||||
|
# https://github.com/MithrilJS/mithril.js/issues/2898
|
||||||
|
# Semantics aren't quite what I'd prefer. This is what I'd really want:
|
||||||
|
# https://github.com/actions/runner/issues/2347#issue-comment-box
|
||||||
|
continue-on-error: true
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./.github/actions/setup
|
||||||
|
- run: npm run lint:docs
|
||||||
|
|
||||||
|
lint-js:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./.github/actions/setup
|
||||||
|
- run: npm run lint:js
|
||||||
|
|
||||||
|
build-js:
|
||||||
|
needs: lint-js
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./.github/actions/setup
|
||||||
|
- run: npm run build
|
||||||
|
|
||||||
|
test-js:
|
||||||
|
needs: build-js
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||||
|
node-version:
|
||||||
|
- 16
|
||||||
|
- 18
|
||||||
|
- 20
|
||||||
|
- 22
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./.github/actions/setup
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
- run: npm run test:js
|
||||||
Loading…
Add table
Add a link
Reference in a new issue