Skip to content

chore: Add GitHub Workflow #131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Build

on:
pull_request:
workflow_dispatch:

# Cancel in-progress runs for the current workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build (Node.js v18)
runs-on: ubuntu-latest

timeout-minutes: 10

steps:
- uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: npm

- name: Install dependencies
run: npm ci

- name: Run build
run: |
npm run build

- name: Run tests
run: |
npm test
env:
BROWSER_STACK_ACCESS_KEY: ${{ secrets.BROWSER_STACK_ACCESS_KEY }}
BROWSER_STACK_USERNAME: ${{ secrets.BROWSER_STACK_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
TEST_BROWSERS: 'ChromeHeadlessNoSandbox,FirefoxHeadless,sl_edge,sl_safari,sl_ios_safari,bs_android_chrome'

- name: Save test results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: test-results-jest
path: junit/*.xml

- name: Prepare installable tarball
if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork }}
run: |
npm pack

- name: Save npm-tarball.tgz
if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork }}
uses: actions/upload-artifact@v4
with:
name: npm-tarball.tgz
path: isomorphic-git-lightning-fs-0.0.0-development.tgz
Comment on lines +55 to +62
Copy link
Preview

Copilot AI Apr 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider parameterizing or verifying the hardcoded tarball file name so that it matches the package version dynamically when changes occur.

Suggested change
npm pack
- name: Save npm-tarball.tgz
if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork }}
uses: actions/upload-artifact@v4
with:
name: npm-tarball.tgz
path: isomorphic-git-lightning-fs-0.0.0-development.tgz
TAR_NAME=$(npm pack | tail -n 1)
echo "TAR_NAME=$TAR_NAME" >> $GITHUB_ENV
- name: Save npm-tarball.tgz
if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork }}
uses: actions/upload-artifact@v4
with:
name: npm-tarball.tgz
path: ${{ env.TAR_NAME }}

Copilot uses AI. Check for mistakes.


- name: Publish to npm
if: ${{ github.ref == 'refs/heads/beta'}}
# if: ${{ github.ref == 'refs/heads/main' || github.ref_name == 'refs/heads/beta' }}
run: |
npm run semantic-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading