Skip to content

Commit 8be7b58

Browse files
committed
chore: fix and enhance/align workflows
1 parent 506209b commit 8be7b58

File tree

9 files changed

+162
-123
lines changed

9 files changed

+162
-123
lines changed

.github/actions/setup.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Setup
2+
description: Setup the environment for the project
3+
4+
inputs:
5+
node-version:
6+
description: Node.js version
7+
required: false
8+
9+
install-deps:
10+
description: Whether to install dependencies
11+
default: true
12+
13+
runs:
14+
using: composite
15+
steps:
16+
- name: Install Node.js
17+
uses: actions/setup-node@v6
18+
with:
19+
node-version-file: ${{ !inputs.node-version && '.node-version' || '' }}
20+
node-version: ${{ inputs.node-version }}
21+
registry-url: https://registry.npmjs.org/
22+
23+
- name: Install pnpm
24+
uses: pnpm/action-setup@v4
25+
26+
- name: Get pnpm store directory
27+
id: pnpm-cache-dir
28+
shell: bash
29+
run: echo "dir=$(pnpm store path)" >> $GITHUB_OUTPUT
30+
31+
- name: Setup pnpm cache
32+
uses: actions/cache@v4
33+
with:
34+
path: ${{ steps.pnpm-cache-dir.outputs.dir }}
35+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
36+
restore-keys: |
37+
${{ runner.os }}-pnpm-store-
38+
39+
- name: Install dependencies
40+
if: ${{ inputs.install-deps }}
41+
shell: bash
42+
run: pnpm install

.github/workflows/ci.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
lint:
17+
name: Lint
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v5
22+
23+
- name: Setup
24+
uses: ./.github/actions/setup
25+
26+
- name: Format
27+
run: pnpm format
28+
29+
- name: Typecheck
30+
run: pnpm typecheck
31+
32+
- name: Lint code
33+
run: pnpm lint:js
34+
35+
### Temporarily disabled, see https://github.com/vitest-dev/eslint-plugin-vitest/issues/754
36+
#- name: Lint docs
37+
# run: pnpm lint:eslint-docs
38+
39+
test:
40+
name: Test (Node.js ${{ matrix.node-version }}, ${{ matrix.os.name }})
41+
runs-on: ${{ matrix.os.version }}
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
node-version:
46+
- 20
47+
- 22
48+
os:
49+
- name: Ubuntu
50+
version: ubuntu-latest
51+
- name: Windows
52+
version: windows-latest
53+
steps:
54+
- name: Checkout repository
55+
uses: actions/checkout@v5
56+
57+
- name: Setup
58+
uses: ./.github/actions/setup
59+
with:
60+
node-version: ${{ matrix.node-version }}
61+
62+
- name: Test
63+
run: pnpm test

.github/workflows/ci.yml

Lines changed: 0 additions & 62 deletions
This file was deleted.

.github/workflows/release.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
gh-release:
10+
name: Create GitHub Release
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v5
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Setup
21+
uses: ./.github/actions/setup
22+
with:
23+
install-deps: false
24+
25+
- run: pnpx conventional-github-releaser -p angular
26+
env:
27+
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/release.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/smoke-test.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Smoke Test
2+
3+
on:
4+
workflow_dispatch: # Manual trigger
5+
schedule: # Every sunday at 00:00
6+
- cron: '0 00 * * SUN'
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v5
14+
15+
- name: Setup
16+
uses: ./.github/actions/setup
17+
with:
18+
node-version: 18
19+
20+
- name: Build
21+
run: pnpm build
22+
23+
- name: Smoke test
24+
uses: AriPerkkio/eslint-remote-tester-run-action@v5
25+
with:
26+
issue-title: 'Results of weekly scheduled smoke test'
27+
eslint-remote-tester-config: eslint-remote-tester.config.ts

.github/workflows/smoke-test.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,11 @@
4040
"scripts": {
4141
"build": "unbuild --config unbuild.config.ts",
4242
"lint:eslint-docs": "pnpm build && eslint-doc-generator --check",
43-
"lint:js": "eslint .",
43+
"lint:js": "eslint",
4444
"lint": "concurrently --prefixColors auto \"pnpm:lint:*\"",
4545
"release": "bumpp package.json --commit --push --tag && pnpm build && pnpm publish",
4646
"stub": "unbuild --stub",
47-
"test:ci": "npm run format:check && vitest run",
48-
"format:check": "npx prettier 'src/**/*.ts' --check",
49-
"format:fix": "npx prettier '**/*.{ts,js}' --write",
47+
"format": "prettier 'src/**/*.{ts,js}' --check",
5048
"test": "vitest",
5149
"update:eslint-docs": "pnpm build && eslint-doc-generator",
5250
"tsc": "tsc --noEmit"

0 commit comments

Comments
 (0)