mirror of
https://github.com/supabase/setup-cli.git
synced 2026-06-27 17:36:57 +00:00
## Summary - Detect Linux musl runners in the v1 action and download the Supabase CLI `.apk` asset for CLI versions `>= 2.99.0`. - Add the extracted `usr/bin` directory to `PATH` for `.apk` archives. - Backport the optional `github-token` input for authenticated `latest` release lookup, because the test matrix hit unauthenticated GitHub API rate limits. - Rebuild `dist/index.js` for the Node action. ## Validation - `npm run format:check` - `npm run lint` - `npm test` - `npm run package` - Local Docker smoke test in `node:20-alpine` with `INPUT_VERSION=2.100.1` - setup-cli-testing workflow: https://github.com/jgoux/setup-cli-testing/actions/runs/26165593808 The external workflow passed Alpine `2.100.1`, Alpine `latest`, and Ubuntu/macOS/Windows with both `2.100.1` and `latest`.
70 lines
1.6 KiB
YAML
70 lines
1.6 KiB
YAML
name: 'build-test'
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: .node-version
|
|
cache: npm
|
|
- run: npm ci
|
|
- run: npm run all
|
|
|
|
- id: diff
|
|
run: |
|
|
if [ ! -d dist/ ]; then
|
|
echo "Expected dist/ directory does not exist. See status below:"
|
|
ls -la ./
|
|
exit 1
|
|
fi
|
|
if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then
|
|
echo "Detected uncommitted changes after build. See status below:"
|
|
git diff --ignore-space-at-eol --text dist/
|
|
exit 1
|
|
fi
|
|
|
|
# Upload the mismatched version as a workflow artifact.
|
|
- if: ${{ failure() && steps.diff.outcome == 'failure' }}
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: dist
|
|
path: dist/
|
|
|
|
test:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
|
version: [1.0.0, latest]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./
|
|
with:
|
|
version: ${{ matrix.version }}
|
|
github-token: ${{ github.token }}
|
|
- run: supabase -h
|
|
|
|
check:
|
|
if: ${{ always() && github.event.pull_request }}
|
|
runs-on: ubuntu-latest
|
|
needs: [test]
|
|
steps:
|
|
- run: |
|
|
result="${{ needs.test.result }}"
|
|
[[ $result == "success" || $result == "skipped" ]]
|