Something went wrong. Try again.
Mirror — see github.com/blacksky-algorithms/blacksky.community
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229# Credit for fingerprint action https://github.com/expo/expo# https://github.com/expo/expo/blob/main/.github/workflows/pr-labeler.yml---name: PR Tests
on: push: branches: [main] pull_request: types: [opened, synchronize]
concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} cancel-in-progress: true
# Permissions are granted per-job below; anything unlisted defaults to none.# pull-requests: write is needed by sticky-pull-request-comment to post the# bundle-size and fingerprint diffspermissions: {}
env: NODE_OPTIONS: --max-old-space-size=4096
jobs: # Populate this from main so every PR can restore the same trusted baseline. webpack-analyzer-base: runs-on: ubuntu-24.04 if: ${{ github.event_name == 'push' }} permissions: contents: read steps: - name: ⬇️ Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
- name: 🔧 Setup Node uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version-file: package.json cache: pnpm
- name: ⬇️ Get base stats from cache id: get-base-stats uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: stats.json key: stats-base-main-${{ github.sha }}
- name: 🔦 Generate stats file for base commit if: ${{ !steps.get-base-stats.outputs.cache-hit }} run: | pnpm install pnpm intl:build pnpm generate-webpack-stats-file
- name: ⬆️ Save base stats to cache if: ${{ !steps.get-base-stats.outputs.cache-hit }} uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: stats.json key: stats-base-main-${{ github.sha }}
webpack-analyzer: runs-on: ubuntu-24.04 if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.event_name == 'pull_request'}} permissions: contents: read pull-requests: write steps: - name: ⬇️ Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
- name: 🔧 Setup Node uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version-file: package.json cache: pnpm
- name: 🌿 Ensure tracking relevant branches and checkout base env: HEAD_REF: ${{ github.head_ref }} BASE_REF: ${{ github.base_ref }} run: | git checkout $HEAD_REF git checkout $BASE_REF
- name: 🔍 Get the base commit id: base-commit env: BASE_REF: ${{ github.base_ref }} run: echo base-commit=$(git log -n 1 $BASE_REF --pretty=format:'%H') >> "$GITHUB_OUTPUT"
- name: 🔀 Merge PR commit env: HEAD_REF: ${{ github.head_ref }} run: | # Have to set a git config for the merge to work git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" git merge --no-edit $HEAD_REF pnpm install pnpm intl:build
- name: 🔦 Generate stats file for PR run: | pnpm generate-webpack-stats-file mv stats.json ../stats-new.json
- name: ⬇️ Get base stats from cache id: get-base-stats # Restore-only prevents PR-scoped fallback builds from creating caches. uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: stats.json key: stats-base-main-${{ steps.base-commit.outputs.base-commit }}
- name: ⏪ Restore to base commit if: ${{ !steps.get-base-stats.outputs.cache-hit }} env: BASE_COMMIT: ${{ steps.base-commit.outputs.base-commit }} run: | git reset "$BASE_COMMIT" git restore .
- name: 🔦 Generate stats file from base commit if: ${{ !steps.get-base-stats.outputs.cache-hit }} run: | pnpm install pnpm intl:build pnpm generate-webpack-stats-file
- name: % Get diff id: get-diff uses: NejcZdovc/bundle-size-diff@5321de41d2d62a7b0f4d6e60f59d1280a0034160 # v1.1.0 with: base_path: "stats.json" pr_path: "../stats-new.json" excluded_assets: "(.+).chunk.js|(.+).js.map|(.+).json|(.+).png|(.+).svg|(.+).webp|(.+).jpg|(.+).ico"
- name: 💬 Drop a comment uses: marocchino/sticky-pull-request-comment@5770ad5eb8f42dd2c4f34da00c94c5381e49af88 # v3.0.5 with: header: bundle-diff message: | | Old size | New size | Diff | |----------|----------|-----------------------| | ${{ steps.get-diff.outputs.base_file_string }} | ${{ steps.get-diff.outputs.pr_file_string }} | ${{ steps.get-diff.outputs.diff_file_string }} (${{ steps.get-diff.outputs.percent }}%) | ---
fingerprint-native: runs-on: ubuntu-22.04 if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.event_name == 'pull_request'}} permissions: contents: read pull-requests: write outputs: # Empty when the native surface is unchanged, 'true' when it changed. includes-changes: ${{ steps.fingerprint.outputs.includes-changes }} steps: - name: ⬇️ Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 100
- name: ⬇️ Fetch commits from base branch run: git fetch origin main:main --depth 100 if: github.event_name == 'pull_request'
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
- name: 🔧 Setup Node uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version-file: package.json cache: pnpm
- name: 📷 Check fingerprint and install dependencies id: fingerprint timeout-minutes: 5 uses: bluesky-social/github-actions/fingerprint-native@abc6a46eb4badf243f55bfd7d6cec42722456300 # v0.3.0 with: profile: pull-request
- name: 💬 Drop a comment uses: marocchino/sticky-pull-request-comment@5770ad5eb8f42dd2c4f34da00c94c5381e49af88 # v3.0.5 if: ${{ steps.fingerprint.outputs.includes-changes }} with: header: fingerprint-diff message: | The Pull Request introduced fingerprint changes against the base commit: <details><summary>Fingerprint diff</summary>
```json ${{ steps.fingerprint.outputs.diff }} ```
</details>
--- *Generated by [PR labeler](https://github.com/expo/expo/actions/workflows/pr-labeler.yml) 🤖*
- name: 💬 Delete comment uses: marocchino/sticky-pull-request-comment@5770ad5eb8f42dd2c4f34da00c94c5381e49af88 # v3.0.5 if: ${{ !steps.fingerprint.outputs.includes-changes }} with: header: fingerprint-diff delete: true
- name: 🏷️ Label as fingerprint changed if: ${{ steps.fingerprint.outputs.includes-changes }} env: GH_TOKEN: ${{ github.token }} PR_NUMBER: ${{ github.event.pull_request.number }} run: | gh pr edit "$PR_NUMBER" --add-label "bot: fingerprint changed" || true
- name: 🏷️ Remove fingerprint changed label if: ${{ !steps.fingerprint.outputs.includes-changes }} env: GH_TOKEN: ${{ github.token }} PR_NUMBER: ${{ github.event.pull_request.number }} run: | gh pr edit "$PR_NUMBER" --remove-label "bot: fingerprint changed" || true