Skip to content

Commit 7953667

Browse files
committed
chore: standardize with other UGRC typescript actions
1 parent e71a2ac commit 7953667

26 files changed

+6155
-44483
lines changed

.github/codeql/codeql-config.yml

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

.github/workflows/codeql-analysis.yml

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

.github/workflows/pull_request.yml

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,32 @@ concurrency:
77
cancel-in-progress: true
88

99
jobs:
10-
lint:
11-
name: Lint
10+
test-check:
11+
name: Lint and check types
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: ⬇️ Set up code
1515
uses: actions/checkout@v4
1616
with:
1717
show-progress: false
1818

19+
- name: 📦 Setup PNPM
20+
uses: pnpm/action-setup@v4
21+
1922
- name: ⎔ Setup Node.js
2023
uses: actions/setup-node@v4
2124
with:
22-
node-version: lts/*
23-
cache: npm
25+
node-version-file: '.node-version'
26+
cache: pnpm
2427

2528
- name: 📥 Download dependencies
26-
run: npm ci
29+
run: pnpm install
2730

2831
- name: 🧵 Lint
29-
run: npm run lint
32+
run: pnpm run lint
33+
34+
- name: 🧪 Check types
35+
run: pnpm run check
3036

3137
test-unit:
3238
name: Unit Tests
@@ -37,17 +43,20 @@ jobs:
3743
with:
3844
show-progress: false
3945

46+
- name: 📦 Setup PNPM
47+
uses: pnpm/action-setup@v4
48+
4049
- name: ⎔ Setup Node.js
4150
uses: actions/setup-node@v4
4251
with:
43-
node-version: lts/*
44-
cache: npm
52+
node-version-file: '.node-version'
53+
cache: pnpm
4554

4655
- name: 📥 Download dependencies
47-
run: npm ci
56+
run: pnpm install
4857

4958
- name: 🧪 Run tests
50-
run: npm test
59+
run: pnpm test
5160

5261
- name: 📤 Report coverage to Codecov
5362
uses: codecov/codecov-action@v5
@@ -57,34 +66,41 @@ jobs:
5766
build:
5867
name: Commit Release Assets
5968
runs-on: ubuntu-latest
69+
needs: [test-check, test-unit]
6070
if: ${{ github.event.sender.login == 'ugrc-release-bot[bot]' }}
6171
permissions:
6272
contents: write
6373
steps:
6474
- name: 🪙 Convert token
6575
uses: actions/create-github-app-token@v2
66-
id: generate_token
76+
id: generate-token
6777
with:
6878
app-id: ${{ secrets.UGRC_RELEASE_BOT_APP_ID }}
6979
private-key: ${{ secrets.UGRC_RELEASE_BOT_APP_KEY }}
7080

7181
- name: ⬇️ Set up code
7282
uses: actions/checkout@v4
7383
with:
74-
ref: ${{ github.head_ref }}
75-
token: ${{ steps.generate_token.outputs.token }}
7684
show-progress: false
85+
ref: ${{ github.head_ref }}
86+
token: ${{ steps.generate-token.outputs.token }}
87+
88+
- name: 📦 Setup PNPM
89+
uses: pnpm/action-setup@v4
7790

7891
- name: ⎔ Setup Node.js
7992
uses: actions/setup-node@v4
8093
with:
81-
node-version: lts/*
82-
cache: npm
94+
node-version-file: '.node-version'
95+
cache: pnpm
8396

8497
- name: 📥 Download dependencies
85-
run: npm ci
98+
run: pnpm install
99+
100+
- name: 🏗️ Build release assets
101+
run: pnpm run build
86102

87-
- name: 🏗️ Commit and push if needed
103+
- name: 📤 Commit and push if needed
88104
run: |
89105
git config user.name "${{ secrets.UGRC_RELEASE_BOT_NAME }}"
90106
git config user.email "${{ secrets.UGRC_RELEASE_BOT_EMAIL }}"

.github/workflows/push.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,26 @@ jobs:
2727
with:
2828
show-progress: false
2929

30+
- name: 📦 Setup PNPM
31+
uses: pnpm/action-setup@v4
32+
3033
- name: ⎔ Setup Node.js
3134
uses: actions/setup-node@v4
3235
with:
33-
node-version: lts/*
34-
cache: npm
36+
node-version-file: '.node-version'
37+
cache: pnpm
3538

3639
- name: 📥 Download dependencies
37-
run: npm ci
40+
run: pnpm install
3841

3942
- name: 🎨 Check format
40-
run: npm run format:check
43+
run: pnpm run format
4144

4245
- name: 🧶 Lint
43-
run: npm run lint
46+
run: pnpm run lint
4447

4548
- name: 🧪 Test
46-
run: npm test
49+
run: pnpm test
4750

4851
release:
4952
name: Create release

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,5 @@ __tests__/runner/*
100100
# IDE files
101101
.idea
102102
*.code-workspace
103+
tsconfig.tsbuildinfo
104+
**/.DS_Store

.node-version

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

.prettierignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
.github/
2+
.vscode/
3+
CHANGELOG.md
4+
coverage/
15
dist/
26
node_modules/
3-
coverage/
47
package-lock.json
5-
CHANGELOG.md
6-
.vscode/
8+
pnpm-lock.yaml
9+
pnpm-workspace.yaml

.prettierrc.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
{
2+
"plugins": ["prettier-plugin-organize-imports", "prettier-plugin-packagejson"],
3+
"printWidth": 120,
24
"singleQuote": true
35
}

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"Basehead",
44
"commitish",
55
"packagejson",
6-
"prereleases"
6+
"prereleases",
7+
"UGRC"
78
],
89
"editor.formatOnSave": true,
910
"editor.defaultFormatter": "esbenp.prettier-vscode",

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright GitHub
3+
Copyright (c) UGRC
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

0 commit comments

Comments
 (0)