Skip to content

Commit f8a3439

Browse files
authored
chore: Add GitHub Workflow
2 parents 5e748e1 + ad2d254 commit f8a3439

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

.github/workflows/ci.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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+
31+
- name: Run build
32+
run: |
33+
npm run build
34+
35+
- name: Run tests
36+
run: |
37+
npm test
38+
env:
39+
BROWSER_STACK_ACCESS_KEY: ${{ secrets.BROWSER_STACK_ACCESS_KEY }}
40+
BROWSER_STACK_USERNAME: ${{ secrets.BROWSER_STACK_USERNAME }}
41+
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
42+
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
43+
TEST_BROWSERS: 'ChromeHeadlessNoSandbox,FirefoxHeadless,sl_edge,sl_safari,sl_ios_safari,bs_android_chrome'
44+
45+
- name: Save test results
46+
if: ${{ !cancelled() }}
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: test-results-jest
50+
path: junit/*.xml
51+
52+
- name: Prepare installable tarball
53+
if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork }}
54+
run: |
55+
npm pack
56+
57+
- name: Save npm-tarball.tgz
58+
if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork }}
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: npm-tarball.tgz
62+
path: isomorphic-git-lightning-fs-0.0.0-development.tgz
63+
64+
- name: Publish to npm
65+
if: ${{ github.ref == 'refs/heads/beta'}}
66+
# if: ${{ github.ref == 'refs/heads/main' || github.ref_name == 'refs/heads/beta' }}
67+
run: |
68+
npm run semantic-release
69+
env:
70+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)