149 lines
3.7 KiB
YAML
149 lines
3.7 KiB
YAML
name: ci
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
semantic_pull_request:
|
|
name: ✅ Semantic Pull Request
|
|
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/semantic_pull_request.yml@v1
|
|
|
|
changes:
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
pull-requests: read
|
|
|
|
outputs:
|
|
needs_dart_build: ${{ steps.needs_dart_build.outputs.changes }}
|
|
needs_rust_build: ${{ steps.needs_rust_build.outputs.changes }}
|
|
needs_verify: ${{ steps.needs_verify.outputs.changes }}
|
|
|
|
name: 👀 Detect Changes
|
|
|
|
steps:
|
|
- name: 📚 Git Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- uses: dorny/paths-filter@v2
|
|
name: Build Detection
|
|
id: needs_dart_build
|
|
with:
|
|
filters: |
|
|
artifact_proxy:
|
|
- ./.github/actions/dart_package
|
|
- packages/artifact_proxy/**
|
|
shorebird_cli:
|
|
- ./.github/actions/dart_package
|
|
- packages/shorebird_cli/**
|
|
- packages/shorebird_code_push_client/**
|
|
shorebird_code_push_client:
|
|
- ./.github/actions/dart_package
|
|
- packages/shorebird_code_push_client/**
|
|
shorebird_code_push_protocol:
|
|
- ./.github/actions/dart_package
|
|
- packages/shorebird_code_push_protocol/**
|
|
jwt:
|
|
- ./.github/actions/dart_package
|
|
- packages/jwt/**
|
|
|
|
- uses: dorny/paths-filter@v2
|
|
name: Build Detection
|
|
id: needs_rust_build
|
|
with:
|
|
filters: |
|
|
updater:
|
|
- ./.github/actions/rust
|
|
- updater/**
|
|
|
|
- uses: dorny/paths-filter@v2
|
|
name: Verify Detection
|
|
id: needs_verify
|
|
with:
|
|
filters: |
|
|
shorebird_cli:
|
|
- ./.github/actions/dart_package
|
|
- packages/shorebird_cli/**
|
|
|
|
build_dart_packages:
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.needs_dart_build != '[]' }}
|
|
|
|
strategy:
|
|
matrix:
|
|
package: ${{ fromJSON(needs.changes.outputs.needs_dart_build) }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: 🎯 Build ${{ matrix.package }}
|
|
|
|
steps:
|
|
- name: 📚 Git Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: 🎯 Build ${{ matrix.package }}
|
|
uses: ./.github/actions/dart_package
|
|
with:
|
|
working_directory: packages/${{ matrix.package }}
|
|
|
|
build_rust_crates:
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.needs_rust_build != '[]' }}
|
|
|
|
strategy:
|
|
matrix:
|
|
crate: ${{ fromJSON(needs.changes.outputs.needs_rust_build) }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: 🦀 Build ${{ matrix.crate }}
|
|
|
|
steps:
|
|
- name: 📚 Git Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: 🦀 Build ${{ matrix.package }}
|
|
uses: ./.github/actions/rust_crate
|
|
with:
|
|
working_directory: ${{ matrix.crate }}
|
|
|
|
verify_packages:
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.needs_verify != '[]' }}
|
|
|
|
strategy:
|
|
matrix:
|
|
package: ${{ fromJSON(needs.changes.outputs.needs_verify) }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: 🔎 Verify ${{ matrix.package }}
|
|
|
|
steps:
|
|
- name: 📚 Git Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: 🔎 Verify ${{ matrix.package }}
|
|
uses: ./.github/actions/verify_version
|
|
with:
|
|
working_directory: packages/${{ matrix.package }}
|
|
|
|
ci:
|
|
needs:
|
|
[
|
|
semantic_pull_request,
|
|
build_dart_packages,
|
|
build_rust_crates,
|
|
verify_packages,
|
|
]
|
|
if: ${{ always() }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: ⛔️ exit(1) on failure
|
|
if: ${{ contains(join(needs.*.result, ','), 'failure') }}
|
|
run: exit 1
|