Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Node 20, clean up workflows #2902

Merged
merged 50 commits into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
ab87cb7
Update merge.yml
dead-claudia Aug 25, 2024
983fcfe
Update lint-js.yml
dead-claudia Aug 25, 2024
2f2d70f
Update pr.yml
dead-claudia Aug 25, 2024
aa74558
Update rollback.yml
dead-claudia Aug 25, 2024
d772471
Update test-js.yml
dead-claudia Aug 25, 2024
4daf147
Update setup.yml
dead-claudia Aug 25, 2024
817fe33
Rename .github/actions/setup.yml to .github/actions/setup/action.yml
dead-claudia Aug 25, 2024
f3cff42
Update lint-docs.yml
dead-claudia Aug 25, 2024
0a79d32
Update lint-js.yml
dead-claudia Aug 25, 2024
d813fe9
Update action.yml
dead-claudia Aug 25, 2024
8263d1a
Update merge.yml
dead-claudia Aug 25, 2024
eb32ee1
Update action.yml
dead-claudia Aug 25, 2024
067e44f
Update lint-docs.yml
dead-claudia Aug 25, 2024
ee40509
Update lint-js.yml
dead-claudia Aug 25, 2024
2b9ffb7
Update merge.yml
dead-claudia Aug 25, 2024
264752f
Update pr.yml
dead-claudia Aug 25, 2024
bdc2a0b
Update rollback.yml
dead-claudia Aug 25, 2024
7989713
Update test-js.yml
dead-claudia Aug 25, 2024
c4365dd
Update action.yml
dead-claudia Aug 25, 2024
71f9dd1
Update test-js.yml
dead-claudia Aug 25, 2024
5cdd7f0
Update test-js.yml
dead-claudia Aug 25, 2024
ccfe36d
Update merge.yml
dead-claudia Aug 25, 2024
1eab83e
Update lint-docs.yml
dead-claudia Aug 25, 2024
6d98946
Update lint-js.yml
dead-claudia Aug 25, 2024
76007c8
Update pr.yml
dead-claudia Aug 25, 2024
2a69136
Update rollback.yml
dead-claudia Aug 25, 2024
81cbbef
Update test-js.yml
dead-claudia Aug 25, 2024
1c8416e
Update test-js.yml
dead-claudia Aug 25, 2024
05b307c
Create test.yml
dead-claudia Aug 25, 2024
492c031
Delete .github/workflows/test-js.yml
dead-claudia Aug 25, 2024
36f802c
Delete .github/workflows/lint-docs.yml
dead-claudia Aug 25, 2024
0aedfb2
Delete .github/workflows/lint-js.yml
dead-claudia Aug 25, 2024
268caaa
Update and rename pr.yml to test-next-push.yml
dead-claudia Aug 25, 2024
d4cb8b1
Update push-master.yml
dead-claudia Aug 25, 2024
9624e21
Update merge.yml
dead-claudia Aug 25, 2024
d14b482
Update rollback.yml
dead-claudia Aug 25, 2024
46a9329
Update test-next-push.yml
dead-claudia Aug 25, 2024
d6f0f69
Update test.yml
dead-claudia Aug 25, 2024
78b72e8
Update action.yml
dead-claudia Aug 25, 2024
ac236f6
Update action.yml
dead-claudia Aug 25, 2024
a76a388
Update test.yml
dead-claudia Aug 25, 2024
65c3cf7
Update merge.yml
dead-claudia Aug 25, 2024
c86fb00
Update rollback.yml
dead-claudia Aug 25, 2024
865f70b
Update test-next-push.yml
dead-claudia Aug 25, 2024
87d14d5
Update push-master.yml
dead-claudia Aug 25, 2024
8554a28
Update test.yml
dead-claudia Aug 25, 2024
41e4688
Update test.yml
dead-claudia Aug 25, 2024
0e89237
Update action.yml
dead-claudia Aug 25, 2024
486a3d9
Update test.yml
dead-claudia Aug 25, 2024
a34966c
Update test.yml
dead-claudia Aug 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 0 additions & 27 deletions .github/workflows/lint-docs.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/lint-js.yml

This file was deleted.

18 changes: 2 additions & 16 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,11 @@ concurrency: prr:deploy

jobs:
merge:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v3
with:
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: git clone --depth=0 https://github.com/MithrilJS/mithril.js.git && cd mithril.js
- uses: ./.github/actions/setup
- 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
env:
Expand Down
22 changes: 10 additions & 12 deletions .github/workflows/push-master.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
name: 'Push `master`'
name: Warn on pushing to `master`
on:
pull_request:
types: [opened]
branches: ['master']
branches: [master]
permissions:
issues: write
jobs:
comment:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
await github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `⚠⚠⚠ Hey @${context.actor}, did you mean to open this against \`next\`? ⚠⚠⚠`
})
- run: |
gh issue comment ${{ github.event.pull_request.url }} \
--body '⚠⚠⚠ Hey @${{ github.actor }}, did you mean to open this against `next`? ⚠⚠⚠'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: Post alert comment
17 changes: 2 additions & 15 deletions .github/workflows/rollback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,11 @@ concurrency: prr:deploy

jobs:
pr:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v3
with:
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: git clone --depth=0 https://github.com/MithrilJS/mithril.js.git && cd mithril.js
- uses: ./.github/actions/setup
- 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
env:
Expand Down
30 changes: 0 additions & 30 deletions .github/workflows/test-js.yml

This file was deleted.

22 changes: 7 additions & 15 deletions .github/workflows/pr.yml → .github/workflows/test-next-push.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
name: pr
name: test-next-push

on:
push:
branches: [ next ]

workflow_dispatch:

concurrency: prr:pre-release

jobs:
pr:
build:
uses: ./.github/workflows/test.yml

publish-prerelease:
needs: build
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

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: git clone --depth=0 https://github.com/MithrilJS/mithril.js.git && cd mithril.js
- uses: ./.github/actions/setup
- run: npm run build
- run: npx pr-release pr --verbose --target master --source next --compact --verbose --minimize-semver-change
env:
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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