Skip to content

Commit c2ba818

Browse files
committed
ci: add ci and cd
1 parent 917d82a commit c2ba818

2 files changed

Lines changed: 71 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
name: CI
3+
4+
on: [pull_request]
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version:
17+
- lts/-1
18+
- lts/*
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
24+
- name: Use Node.js ${{ matrix.node-version }}
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
cache: npm
29+
30+
- name: Cache npm dependencies
31+
uses: actions/cache@v3
32+
id: cache-node-modules
33+
with:
34+
path: node_modules
35+
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
36+
37+
- name: Install npm dependencies
38+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
39+
run: npm ci --ignore-scripts
40+
41+
- name: Compile TypeScript
42+
run: npm run build
43+
44+
- name: Test
45+
run: npm test

.github/workflows/release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Release
3+
4+
on:
5+
push:
6+
branches:
7+
- master
8+
- next
9+
- next-major
10+
- beta
11+
- alpha
12+
- "[0-9]+.[0-9]+.x"
13+
- "[0-9]+.x"
14+
15+
# Only allow one release workflow to execute at a time, since each release
16+
# workflow uses shared resources (git tags, package registries)
17+
concurrency:
18+
group: ${{ github.workflow }}
19+
20+
jobs:
21+
release:
22+
name: Release
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- uses: EricCrosson/semantic-release-your-github-action@v3

0 commit comments

Comments
 (0)