Skip to content

Commit 9ddd1bf

Browse files
committed
chore: Add GitHub Workflow
1 parent 5e748e1 commit 9ddd1bf

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

.github/workflows/ci.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Build
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
# Cancel in-progress runs for the current workflow
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
build:
14+
name: Build (Node.js v18)
15+
runs-on: ubuntu-latest
16+
17+
timeout-minutes: 10
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Install Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 18
26+
cache: npm
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
env:
31+
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
32+
PUPPETEER_SKIP_DOWNLOAD: true
33+
34+
- name: Run build
35+
run: |
36+
npm run build
37+
38+
- name: Run tests
39+
run: |
40+
npm test
41+
env:
42+
BROWSER_STACK_ACCESS_KEY: ${{ secrets.BROWSER_STACK_ACCESS_KEY }}
43+
BROWSER_STACK_USERNAME: ${{ secrets.BROWSER_STACK_USERNAME }}
44+
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
45+
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
46+
TEST_BROWSERS: 'ChromeHeadlessNoSandbox,FirefoxHeadless,sl_edge,sl_safari,sl_ios_safari,bs_android_chrome'
47+
48+
- name: Save test results
49+
if: ${{ !cancelled() }}
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: test-results-jest
53+
path: junit/*.xml
54+
55+
- name: Prepare installable tarball
56+
if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork }}
57+
run: |
58+
npm pack
59+
60+
- name: Save npm-tarball.tgz
61+
if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork }}
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: npm-tarball.tgz
65+
path: isomorphic-git-lightning-fs-0.0.0-development.tgz
66+
67+
- name: Publish to npm
68+
if: ${{ github.ref == 'beta'}}
69+
# if: ${{ github.ref == 'main' || github.ref_name == 'beta' }}
70+
run: |
71+
npm run semantic-release
72+
env:
73+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)