chore(deps): bump astro from 4.16.17 to 4.16.18 (#646) #123
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
concurrency: | |
group: ${{ github.ref_name || github.sha }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
env: | |
BUILD_CACHE_KEY: ${{ github.sha }} | |
CACHED_BUILD_PATHS: | | |
${{ github.workspace }}/packages/*/dist | |
${{ github.workspace }}/packages/*/dist-bin | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: 'package.json' | |
cache: 'pnpm' | |
- name: Setup NPM dependencies | |
run: pnpm install | |
- name: Setup Codesign Dependencies | |
env: | |
APPLE_CERT_DATA: ${{ secrets.CSC_LINK }} | |
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }} | |
run: | | |
curl -L 'https://github.com/indygreg/apple-platform-rs/releases/download/apple-codesign%2F0.28.0/apple-codesign-0.28.0-x86_64-unknown-linux-musl.tar.gz' | tar -xz --strip-components=1 | |
mv rcodesign /usr/local/bin/rcodesign | |
# Export certs | |
echo "$APPLE_CERT_DATA" | base64 --decode > /tmp/certs.p12 | |
echo 'APPLE_CERT_PATH=/tmp/certs.p12' >> $GITHUB_ENV | |
echo "$APPLE_API_KEY" | base64 -d > /tmp/apple_key.json | |
echo 'APPLE_API_KEY_PATH=/tmp/apple_key.json' >> $GITHUB_ENV | |
- name: Build packages | |
env: | |
BUILD_PLATFORMS: 'linux-x64,linux-arm64,win-x64,darwin-x64,darwin-arm64' | |
APPLE_CERT_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} | |
APPLE_TEAM_ID: ${{ secrets.TEAMID }} | |
run: pnpm build | |
- name: Smoke test | |
env: | |
SPOTLIGHT_BINARY: ${{ github.workspace }}/packages/spotlight/dist-bin/spotlight-${{ runner.os }}-${{ runner.arch }} | |
run: | | |
# Lowercase the binary name because `runner.os` and `runner.arch` are uppercase :facepalm: | |
SPOTLIGHT_BINARY=$(echo "$SPOTLIGHT_BINARY" | tr '[:upper:]' '[:lower:]') | |
[ -f "$SPOTLIGHT_BINARY" ] | |
$SPOTLIGHT_BINARY & | |
SPOTLIGHT_PID=$! | |
curl -sf --retry 3 --retry-all-errors -o /dev/null 'http://localhost:8969/' && echo "Spotlight ran successfully" | |
kill -2 $SPOTLIGHT_PID | |
- name: Store Spotlight CJS | |
uses: actions/upload-artifact@v4 | |
with: | |
name: spotlight-cjs | |
if-no-files-found: error | |
path: | | |
packages/spotlight/dist/spotlight.cjs | |
packages/spotlight/dist/overlay/ | |
- name: Store standalone spotlight binaries | |
uses: actions/upload-artifact@v4 | |
with: | |
name: spotlight | |
if-no-files-found: error | |
path: packages/spotlight/dist-bin/spotlight-* | |
- name: Update build cache | |
uses: actions/cache/save@v4 | |
with: | |
enableCrossOsArchive: true | |
path: ${{ env.CACHED_BUILD_PATHS }} | |
key: ${{ env.BUILD_CACHE_KEY }} | |
test-unit: | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node_version: [18, 20, 22] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node_version }} | |
cache: 'pnpm' | |
- name: Setup dependencies | |
run: pnpm install | |
- name: Run tests | |
run: pnpm test | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@v4 | |
if: success() || failure() | |
with: | |
report_paths: '**/junit.xml' | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
test-e2e: | |
name: E2E Tests | |
needs: build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node_version: [18, 20, 22] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node_version }} | |
cache: 'pnpm' | |
- name: Setup dependencies | |
run: pnpm install | |
- name: Restore build cache | |
uses: actions/cache/restore@v4 | |
with: | |
enableCrossOsArchive: true | |
fail-on-cache-miss: true | |
path: ${{ env.CACHED_BUILD_PATHS }} | |
key: ${{ env.BUILD_CACHE_KEY }} | |
- name: Test Demos | |
run: pnpm test:demos | |
- name: Run tests | |
run: pnpm test:e2e | |
docker: | |
name: Docker Image | |
needs: build | |
runs-on: ubuntu-latest | |
if: | | |
!cancelled() | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Restore build cache | |
uses: actions/cache/restore@v4 | |
with: | |
enableCrossOsArchive: true | |
fail-on-cache-miss: true | |
path: ${{ env.CACHED_BUILD_PATHS }} | |
key: ${{ env.BUILD_CACHE_KEY }} | |
- name: Rename x64 to amd64 | |
# This is because Node ecosystem uses x64, but Docker uses amd64 :shrug: | |
run: mv packages/spotlight/dist-bin/spotlight-linux-x64 packages/spotlight/dist-bin/spotlight-linux-amd64 | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup QEMU for cross-compilation | |
uses: docker/setup-qemu-action@v3 | |
- name: Configure Docker Context | |
uses: docker/setup-buildx-action@v3 | |
- name: Build Docker Image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
cache-from: type=gha,scope=prod | |
cache-to: type=gha,mode=max,scope=prod | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ghcr.io/getsentry/spotlight:${{ github.sha }} | |
- name: Test Docker Image | |
run: | | |
docker run --rm -d -p 8969:8969 ghcr.io/getsentry/spotlight:${{ github.sha }} | |
curl -sf --retry 3 --retry-all-errors -o /dev/null 'http://localhost:8969/' && echo "Spotlight ran successfully" |