Skip to content

Commit d91106b

Browse files
committed
ci: set up GHA
1 parent 31a117a commit d91106b

File tree

4 files changed

+60
-0
lines changed

4 files changed

+60
-0
lines changed

.github/CODEOWNERS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@scratchfoundation/scratch-engineering

.github/workflows/ci-cd.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI/CD
2+
3+
on:
4+
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
5+
push: # Runs whenever a commit is pushed to the repository
6+
7+
concurrency:
8+
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
9+
cancel-in-progress: true
10+
11+
permissions:
12+
contents: write # publish a GitHub release
13+
pages: write # deploy to GitHub Pages
14+
issues: write # comment on released issues
15+
pull-requests: write # comment on released pull requests
16+
17+
jobs:
18+
ci-cd:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
22+
23+
- uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3
24+
with:
25+
cache: "npm"
26+
node-version-file: ".nvmrc"
27+
28+
- name: Info
29+
run: |
30+
cat <<EOF
31+
Node version: $(node --version)
32+
NPM version: $(npm --version)
33+
GitHub ref: ${{ github.ref }}
34+
GitHub head ref: ${{ github.head_ref }}
35+
EOF
36+
37+
- run: npm ci
38+
39+
- run: npm test
40+
41+
- name: Semantic release
42+
env:
43+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
run: |
46+
npx --no -- semantic-release

.github/workflows/commitlint.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Lint commit messages
2+
on: [pull_request]
3+
4+
concurrency:
5+
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.sha }}"
6+
7+
jobs:
8+
commitlint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
12+
- uses: wagoid/commitlint-github-action@5ce82f5d814d4010519d15f0552aec4f17a1e1fe # v5

.nvmrc

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

0 commit comments

Comments
 (0)