Files
self/.github/workflows/mobile-sdk-ci.yml
Justin Hernandez 7a7a597545 Optimize CI workflows and add core SDK checks (#885)
* Parallelize mobile SDK CI and add core workflow

* fix tests for now

* test build improvements

* fix: add explicit Corepack setup to fix Yarn version issues in CI

* security: add minimal permissions, pin actions to SHAs, and improve checksum verification

* refactor: remove redundant Corepack setup from npm-publish and core-sdk-ci workflows

* simplify action versions
2025-08-12 18:12:56 -07:00

117 lines
3.4 KiB
YAML

name: Mobile SDK CI
on:
pull_request:
paths:
- "packages/mobile-sdk-alpha/**"
- ".github/workflows/mobile-sdk-ci.yml"
- ".github/actions/**"
jobs:
# Build dependencies once and cache for other jobs
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
uses: ./.github/actions/yarn-install
- name: Build dependencies
shell: bash
run: |
yarn workspace @selfxyz/common build
yarn workspace @selfxyz/mobile-sdk-alpha build
- name: Cache build artifacts
uses: actions/cache/save@v4
with:
path: |
common/dist
packages/mobile-sdk-alpha/dist
node_modules
packages/mobile-sdk-alpha/node_modules
common/node_modules
key: mobile-sdk-alpha-build-${{ github.sha }}
lint:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
uses: ./.github/actions/yarn-install
- name: Restore build artifacts
uses: actions/cache/restore@v4
with:
path: |
common/dist
packages/mobile-sdk-alpha/dist
node_modules
packages/mobile-sdk-alpha/node_modules
common/node_modules
key: mobile-sdk-alpha-build-${{ github.sha }}
fail-on-cache-miss: true
- name: Run linter
run: yarn workspace @selfxyz/mobile-sdk-alpha lint
format:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
uses: ./.github/actions/yarn-install
- name: Restore build artifacts
uses: actions/cache/restore@v4
with:
path: |
common/dist
packages/mobile-sdk-alpha/dist
node_modules
packages/mobile-sdk-alpha/node_modules
common/node_modules
key: mobile-sdk-alpha-build-${{ github.sha }}
fail-on-cache-miss: true
- name: Check Prettier formatting
run: yarn workspace @selfxyz/mobile-sdk-alpha prettier --check .
types:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
uses: ./.github/actions/yarn-install
- name: Restore build artifacts
uses: actions/cache/restore@v4
with:
path: |
common/dist
packages/mobile-sdk-alpha/dist
node_modules
packages/mobile-sdk-alpha/node_modules
common/node_modules
key: mobile-sdk-alpha-build-${{ github.sha }}
fail-on-cache-miss: true
- name: Type checking
run: yarn workspace @selfxyz/mobile-sdk-alpha types
test:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
uses: ./.github/actions/yarn-install
- name: Restore build artifacts
uses: actions/cache/restore@v4
with:
path: |
common/dist
packages/mobile-sdk-alpha/dist
node_modules
packages/mobile-sdk-alpha/node_modules
common/node_modules
key: mobile-sdk-alpha-build-${{ github.sha }}
fail-on-cache-miss: true
- name: Run tests
run: yarn workspace @selfxyz/mobile-sdk-alpha test