From 9ddd1bfbf761d10824313e5f5777279f1e25d9d5 Mon Sep 17 00:00:00 2001 From: Sean Poulter Date: Mon, 28 Apr 2025 17:47:37 -0400 Subject: [PATCH 1/3] chore: Add GitHub Workflow --- .github/workflows/ci.yml | 74 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1d69b3d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,74 @@ +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 + env: + PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true + PUPPETEER_SKIP_DOWNLOAD: true + + - 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 + + - name: Publish to npm + if: ${{ github.ref == 'beta'}} + # if: ${{ github.ref == 'main' || github.ref_name == 'beta' }} + run: | + npm run semantic-release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} From 1b443c0d3a1ae5e96b9d1939a7cca35d6c604695 Mon Sep 17 00:00:00 2001 From: Sean Poulter Date: Mon, 28 Apr 2025 17:49:44 -0400 Subject: [PATCH 2/3] fix: Remove unnecessary environment variables --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d69b3d..669f671 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,9 +27,6 @@ jobs: - name: Install dependencies run: npm ci - env: - PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true - PUPPETEER_SKIP_DOWNLOAD: true - name: Run build run: | From ad2d25488b8628f3e8d90f061ea901d43d5db452 Mon Sep 17 00:00:00 2001 From: Sean Poulter Date: Mon, 28 Apr 2025 19:05:25 -0400 Subject: [PATCH 3/3] fix: github.ref uses the fully-formed ref --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 669f671..aa16b3f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,8 +62,8 @@ jobs: path: isomorphic-git-lightning-fs-0.0.0-development.tgz - name: Publish to npm - if: ${{ github.ref == 'beta'}} - # if: ${{ github.ref == 'main' || github.ref_name == 'beta' }} + if: ${{ github.ref == 'refs/heads/beta'}} + # if: ${{ github.ref == 'refs/heads/main' || github.ref_name == 'refs/heads/beta' }} run: | npm run semantic-release env: