Skip to content

Commit fb4e067

Browse files
committed
refactor(ci): structure of workflow
chore(license): re-add licensed check
1 parent 3087e1b commit fb4e067

536 files changed

Lines changed: 30950 additions & 181 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/Check-dist.yml

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

.github/workflows/check.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Check Codebase
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
permissions:
12+
contents: read
13+
packages: read
14+
statuses: write
15+
16+
jobs:
17+
check:
18+
name: Check Codebase
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v6
28+
with:
29+
node-version-file: .node-version
30+
check-latest: true
31+
32+
- name: Install pnpm
33+
uses: pnpm/action-setup@v4
34+
with:
35+
cache: true
36+
37+
- name: Install dependencies
38+
run: pnpm i --frozen-lockfile
39+
40+
- name: Lint Codebase
41+
run: |
42+
pnpm run lint
43+
pnpm run typecheck
44+
pnpm run knip
45+
46+
- name: Test Codebase
47+
run: pnpm run test

.github/workflows/licensed.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,19 @@ jobs:
3030
uses: actions/checkout@v4
3131

3232
- name: Setup Node.js
33-
id: setup-node
34-
uses: actions/setup-node@v4
33+
uses: actions/setup-node@v6
3534
with:
3635
node-version-file: .node-version
37-
cache: npm
36+
check-latest: true
3837

39-
- name: Install Dependencies
40-
id: npm-ci
41-
run: npm ci
38+
- name: Install pnpm
39+
uses: pnpm/action-setup@v4
40+
with:
41+
cache: true
42+
43+
- name: Install dependencies
44+
run: |
45+
pnpm i --frozen-lockfile
4246
4347
- name: Setup Ruby
4448
id: setup-ruby
@@ -48,7 +52,7 @@ jobs:
4852

4953
- uses: licensee/setup-licensed@v1.3.2
5054
with:
51-
version: 4.x
55+
version: 5.x
5256
github_token: ${{ secrets.GITHUB_TOKEN }}
5357

5458
# If this is a workflow_dispatch event, update the cached licenses.
@@ -65,7 +69,7 @@ jobs:
6569
git config --local user.email "licensed-ci@users.noreply.github.com"
6670
git config --local user.name "licensed-ci"
6771
git add .
68-
git commit -m "Auto-update license files"
72+
git commit -m "chore(license): auto-update license files"
6973
git push
7074
7175
# Last, check the status of the cached licenses.

.github/workflows/linter.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.
Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# This is a basic workflow to help you get started with Actions
22

3-
name: CI
3+
name: Test Action
44

55
# Controls when the action will run.
66
on:
77
# Triggers the workflow on push or pull request events but only for the master branch
88
push:
9-
branches: [master]
9+
branches:
10+
- master
11+
paths:
12+
- .github/workflows/test.yml
13+
- 'dist/**'
1014
pull_request:
1115

1216
# Allows you to run this workflow manually from the Actions tab
@@ -17,8 +21,8 @@ permissions:
1721

1822
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1923
jobs:
20-
# This workflow contains a single job called "CI"
21-
CI:
24+
# This workflow contains a single job called "test"
25+
test:
2226
# The type of runners that the job will run on
2327
strategy:
2428
fail-fast: false
@@ -37,30 +41,24 @@ jobs:
3741
# Steps represent a sequence of tasks that will be executed as part of the job
3842
steps:
3943
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
40-
- uses: actions/checkout@v4
41-
4244
- name: Setup Node.js
43-
id: setup-node
44-
uses: actions/setup-node@v4
45+
uses: actions/setup-node@v6
4546
with:
4647
node-version-file: .node-version
47-
cache: npm
48-
49-
- name: Install Dependencies
50-
id: npm-ci
51-
run: npm ci
48+
check-latest: true
5249

53-
- name: Check Format
54-
id: npm-format-check
55-
run: npm run format:check
50+
- name: Install pnpm
51+
uses: pnpm/action-setup@v4
52+
with:
53+
cache: true
5654

57-
- name: Lint
58-
id: npm-lint
59-
run: npm run lint
55+
- name: Install dependencies
56+
run: |
57+
pnpm i --frozen-lockfile
6058
61-
- name: Test
62-
id: npm-ci-test
63-
run: npm run ci-test
59+
- name: Build
60+
run: |
61+
pnpm run package
6462
6563
- name: Run the action on this runner with method ${{matrix.method}}
6664
uses: ./
Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,39 @@
1-
# `dist/index.js` is a special file in Actions.
2-
# When you reference an action with `uses:` in a workflow,
3-
# `index.js` is the code that will run.
4-
# For our project, we generate this file through a build process from other source files.
5-
# We need to make sure the checked-in `index.js` actually matches what we expect it to be.
6-
name: Auto Compile dist/index.js
1+
name: Auto Update dist/index.js
72

83
on:
9-
workflow_dispatch:
10-
inputs:
11-
force_compile:
12-
description: Force compile the dist/index.js file
13-
required: false
14-
type: boolean
154
push:
165
branches:
176
- master
18-
- compile
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
1911

2012
jobs:
2113
auto_compile:
2214
runs-on: ubuntu-latest
23-
permissions:
24-
contents: write
2515
steps:
26-
- uses: actions/checkout@v4
16+
- name: Checkout
17+
uses: actions/checkout@v4
2718
with:
28-
ref: master
19+
fetch-depth: 0
2920

30-
- name: Set Node.js
21+
- name: Setup Node.js
3122
uses: actions/setup-node@v6
3223
with:
3324
node-version-file: .node-version
3425
check-latest: true
3526

36-
- uses: pnpm/action-setup@v4
37-
name: Install pnpm
27+
- name: Install pnpm
28+
uses: pnpm/action-setup@v4
3829
with:
3930
cache: true
4031

4132
- name: Install dependencies
42-
run: |
43-
pnpm i --frozen-lockfile
33+
run: pnpm i --frozen-lockfile
4434

4535
- name: Rebuild the dist/ directory
46-
run: pnpm run package
36+
run: pnpm run build
4737

4838
- name: Upload dist/index.cjs to GitHub Repository
4939
run: |

.licensed.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# See: https://github.com/licensee/licensed/blob/main/docs/configuration.md
2+
3+
sources:
4+
npm: true
5+
6+
allowed:
7+
- apache-2.0
8+
- bsd-2-clause
9+
- bsd-3-clause
10+
- isc
11+
- mit
12+
- cc0-1.0
13+
- other
14+
- 0bsd
15+
- blueoak-1.0.0
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: "@actions/artifact"
3+
version: 6.2.1
4+
type: npm
5+
summary: Actions artifact lib
6+
homepage: https://github.com/actions/toolkit/tree/main/packages/artifact
7+
license: mit
8+
licenses:
9+
- sources: LICENSE.md
10+
text: |-
11+
The MIT License (MIT)
12+
13+
Copyright 2019 GitHub
14+
15+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
16+
17+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
18+
19+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20+
notices: []

0 commit comments

Comments
 (0)