Skip to content

Commit a64c20a

Browse files
committed
testing out GH Actions instead of CircleCI
1 parent b487f93 commit a64c20a

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/ci.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: CI
5+
6+
on:
7+
push:
8+
branches: ["main"]
9+
pull_request:
10+
branches: ["main"]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
node-version: [20.x] # [14.x, 16.x, 18.x]
19+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Install Node.js ${{ matrix.node-version }}
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
30+
- uses: pnpm/action-setup@v4
31+
name: Install pnpm
32+
with:
33+
version: 8
34+
run_install: false
35+
36+
- name: Get pnpm store directory
37+
shell: bash
38+
run: |
39+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
40+
41+
- uses: actions/cache@v4
42+
name: Setup pnpm cache
43+
with:
44+
path: ${{ env.STORE_PATH }}
45+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
46+
restore-keys: |
47+
${{ runner.os }}-pnpm-store-
48+
49+
- name: Install dependencies
50+
run: pnpm install
51+
52+
- name: Lint
53+
run: pnpm run lint --format junit -o reports/junit/js-lint-results.xml
54+
55+
- name: Test
56+
run: pnpm run test --ci --runInBand --reporters=default --reporters=jest-junit --coverage
57+
env:
58+
JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml"
59+
60+

0 commit comments

Comments
 (0)