SDK #4
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: SDK | |
on: | |
workflow_dispatch: | |
inputs: | |
checkAll: | |
description: 'type "check-all" to force checking all packages' | |
required: false | |
default: '' | |
push: | |
branches: [main, 'sdk-*'] | |
paths: | |
- .github/workflows/sdk.yml | |
- tools/** | |
- packages/** | |
- yarn.lock | |
pull_request: | |
paths: | |
- .github/workflows/sdk.yml | |
- tools/** | |
- packages/** | |
- yarn.lock | |
schedule: | |
- cron: 0 14 * * * | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check-packages: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: 👀 Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 100 | |
- name: ⬇️ Fetch commits from base branch | |
run: git fetch origin ${{ github.base_ref || github.event.before || 'main' }}:${{ github.base_ref || github.event.before || 'main' }} --depth 100 | |
if: github.event_name == 'pull_request' | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: ♻️ Restore caches | |
uses: ./.github/actions/expo-caches | |
id: expo-caches | |
with: | |
yarn-workspace: 'true' | |
yarn-tools: 'true' | |
- name: 🧶 Install workspace node modules | |
if: steps.expo-caches.outputs.yarn-workspace-hit != 'true' | |
run: yarn install --frozen-lockfile | |
- name: 🧐 Check packages | |
run: | | |
echo "Checking packages according to the event name: ${{ github.event_name }}" | |
if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event.inputs.checkAll }}" == "check-all" ]]; then | |
# Check all packages on scheduled events or if requested by workflow_dispatch event. | |
bin/expotools check-packages --all | |
else | |
# On push event check packages changed since previous remote head. | |
# In pull requests and workflow_dispatch events check all packages changed in the entire PR. | |
bin/expotools check-packages --since ${{ github.base_ref || github.event.before || 'main' }} | |
fi | |
- name: 🔔 Notify on Slack | |
uses: 8398a7/action-slack@v3 | |
if: failure() && (github.event_name == 'schedule' || github.event.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/heads/sdk-')) | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_api }} | |
with: | |
channel: '#expo-sdk' | |
status: ${{ job.status }} | |
fields: job,message,ref,eventName,author,took | |
author_name: Check packages |