Skip to content

Commit 4e46226

Browse files
committedApr 14, 2024·
add github actions
1 parent 0c0c1f0 commit 4e46226

File tree

3 files changed

+76
-13
lines changed

3 files changed

+76
-13
lines changed
 

‎.circleci/config.yml

-13
This file was deleted.

‎.github/workflows/coverage.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Deploy coverate report to Pages
2+
3+
on:
4+
# Runs on pushes targeting the default branch
5+
push:
6+
branches: ["master"]
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
19+
concurrency:
20+
group: "pages"
21+
cancel-in-progress: false
22+
23+
jobs:
24+
# Single deploy job since we're just deploying
25+
coverage:
26+
environment:
27+
name: github-pages
28+
url: ${{ steps.deployment.outputs.page_url }}
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v3
33+
- name: Use Node.js 18
34+
uses: actions/setup-node@v3
35+
with:
36+
node-version: '18.x'
37+
- run: npm install
38+
- run: npm run build --if-present
39+
- run: npm test
40+
- run: npx lcov-badge2 coverage/lcov.info -o coverage/lcov-report/badge.svg
41+
- name: Setup Pages
42+
uses: actions/configure-pages@v3
43+
- name: Upload artifact
44+
uses: actions/upload-pages-artifact@v2
45+
with:
46+
path: 'coverage/lcov-report'
47+
- name: Deploy to GitHub Pages
48+
id: deployment
49+
uses: actions/deploy-pages@v2
50+

‎.github/workflows/test.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Node.js CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [18.x]
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
- run: npm install
25+
- run: npm run build --if-present
26+
- run: npm test

0 commit comments

Comments
 (0)
Please sign in to comment.