Skip to content

Commit 71a4134

Browse files
authored
Merge pull request #372 from consideRatio/pr/misc-maintenance-details
ci: test against node 17, rely on pre-commit.ci, tweak workflow triggers and comments
2 parents 6cdb674 + 4a708b4 commit 71a4134

File tree

3 files changed

+52
-40
lines changed

3 files changed

+52
-40
lines changed

.github/workflows/publish.yml

+17-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
1+
# This is a GitHub workflow defining a set of jobs with a set of steps.
2+
# ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
3+
#
14
# Publish NPM package and Docker image
5+
#
26
name: Release
37

48
on:
9+
pull_request:
10+
paths-ignore:
11+
- "**.md"
12+
- ".github/workflows/*"
13+
- "!.github/workflows/publish.yml"
514
push:
15+
paths-ignore:
16+
- "**.md"
17+
- ".github/workflows/*"
18+
- "!.github/workflows/publish.yml"
619
branches-ignore:
7-
# don't double-build dependabot PRs
8-
- dependabot/**
9-
tags: ["**"]
10-
pull_request:
20+
- "dependabot/**"
21+
- "pre-commit-ci-update-config"
22+
tags:
23+
- "**"
1124
workflow_dispatch:
1225

1326
jobs:

.github/workflows/test.yml

+25-36
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
# Useful GitHub Actions docs:
1+
# This is a GitHub workflow defining a set of jobs with a set of steps.
2+
# ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
23
#
3-
# - https://help.github.com/en/actions
4-
# - https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
5-
# - https://help.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow
6-
# - https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions
7-
84
name: Test
95

106
on:
7+
pull_request:
8+
paths-ignore:
9+
- "**.md"
10+
- ".github/workflows/*"
11+
- "!.github/workflows/publish.yml"
1112
push:
13+
paths-ignore:
14+
- "**.md"
15+
- ".github/workflows/*"
16+
- "!.github/workflows/publish.yml"
1217
branches-ignore:
13-
# don't double-build dependabot PRs
14-
- dependabot/**
15-
tags: ["**"]
16-
pull_request:
18+
- "dependabot/**"
19+
- "pre-commit-ci-update-config"
20+
tags:
21+
- "**"
1722
workflow_dispatch:
1823

1924
jobs:
20-
# Job to run linter / autoformat
21-
lint:
25+
# Audit dependencies for known vulnerabilities
26+
audit-dependencies:
2227
runs-on: ubuntu-20.04
2328
steps:
24-
# Action Repo: https://github.com/actions/checkout
25-
- name: "Checkout repo"
26-
uses: actions/checkout@v2
27-
28-
# Action Repo: https://github.com/actions/setup-node
29-
- name: "Setup Node"
30-
uses: actions/setup-node@v1
29+
- uses: actions/checkout@v2
30+
- uses: actions/setup-node@v1
3131
with:
32-
node-version: "14"
32+
node-version: "16"
3333

3434
# Action Repo: https://github.com/actions/cache
3535
- name: "Cache node_modules"
@@ -40,23 +40,17 @@ jobs:
4040
restore-keys: |
4141
${{ runner.os }}-npm-
4242
43-
- name: "Install"
43+
- name: "Install dependencies (npm ci)"
4444
run: |
4545
npm ci
4646
47-
# Run the pre-commit action
48-
# Repo: https://github.com/pre-commit/action
49-
- uses: actions/setup-python@v2
50-
- uses: pre-commit/[email protected]
51-
5247
- name: npm audit
5348
run: |
5449
# If this fails, run `npm audit fix`
5550
npm audit --production --audit-level=moderate
5651
5752
test:
5853
runs-on: ubuntu-20.04
59-
# - https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategy
6054
strategy:
6155
fail-fast: false # Do not cancel all jobs if one fails
6256
matrix:
@@ -68,17 +62,12 @@ jobs:
6862
- "10"
6963
- "12"
7064
- "14"
71-
- "15" # Remove about when 17 is available?
7265
- "16"
73-
# - "17" # Add 2021-10-19, its initial release date.
66+
- "17"
7467

7568
steps:
76-
- name: "Checkout repo"
77-
uses: actions/checkout@v2
78-
79-
# Action Repo: https://github.com/actions/setup-node
80-
- name: "Setup Node"
81-
uses: actions/setup-node@v1
69+
- uses: actions/checkout@v2
70+
- uses: actions/setup-node@v1
8271
with:
8372
node-version: ${{ matrix.node_version }}
8473

@@ -91,7 +80,7 @@ jobs:
9180
restore-keys: |
9281
${{ runner.os }}-npm-
9382
94-
- name: "Install dependencies"
83+
- name: "Install dependencies (npm ci)"
9584
run: |
9685
npm ci
9786

.pre-commit-config.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# pre-commit is a tool to perform a predefined set of tasks manually and/or
2+
# automatically before git commits are made.
3+
#
4+
# Config reference: https://pre-commit.com/#pre-commit-configyaml---top-level
5+
#
6+
# Common tasks
7+
#
8+
# - Run on all files: pre-commit run --all-files
9+
# - Register git hooks: pre-commit install --install-hooks
10+
#
111
repos:
212
# Autoformat: Bash scripts
313
- repo: https://github.com/lovesegfault/beautysh

0 commit comments

Comments
 (0)