Files
self/.github/workflows/common-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

76 lines
2.2 KiB
YAML

name: Common CI
on:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
uses: ./.github/actions/yarn-install
- name: Build @selfxyz/common
run: yarn workspace @selfxyz/common build
- name: Cache build artifacts
uses: actions/cache/save@v4
with:
path: common/dist
key: common-build-${{ runner.os }}-${{ github.sha }}
lint:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
uses: ./.github/actions/yarn-install
- name: Run linter
run: yarn workspace @selfxyz/common lint
type-check:
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
uses: ./.github/actions/yarn-install
- name: Restore build artifacts
id: restore-common-dist
uses: actions/cache/restore@v4
with:
path: common/dist
key: common-build-${{ runner.os }}-${{ github.sha }}
fail-on-cache-miss: false
- name: Build @selfxyz/common (fallback on cache miss)
if: steps.restore-common-dist.outputs.cache-hit != 'true'
run: yarn workspace @selfxyz/common build
- name: Yarn types
run: yarn types
test-common:
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
uses: ./.github/actions/yarn-install
- name: Restore build artifacts
id: restore-common-dist
uses: actions/cache/restore@v4
with:
path: common/dist
key: common-build-${{ runner.os }}-${{ github.sha }}
fail-on-cache-miss: false
- name: Build @selfxyz/common (fallback on cache miss)
if: steps.restore-common-dist.outputs.cache-hit != 'true'
run: yarn workspace @selfxyz/common build
- name: Run @selfxyz/common tests
run: yarn workspace @selfxyz/common test