73 lines
1.6 KiB
YAML
73 lines
1.6 KiB
YAML
name: ci
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
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_rust_build: ${{ steps.needs_rust_build.outputs.changes }}
|
|
|
|
name: 👀 Detect Changes
|
|
|
|
steps:
|
|
- name: 📚 Git Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- uses: dorny/paths-filter@v2
|
|
name: Build Detection
|
|
id: needs_rust_build
|
|
with:
|
|
filters: |
|
|
library:
|
|
- ./.github/actions/rust_crate/action.yaml
|
|
- library/**
|
|
patch:
|
|
- ./.github/actions/rust_crate/action.yaml
|
|
- patch/**
|
|
|
|
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:
|
|
codecov_token: ${{ secrets.CODECOV_TOKEN }}
|
|
working_directory: ${{ matrix.crate }}
|
|
|
|
ci:
|
|
needs: [semantic_pull_request, build_rust_crates]
|
|
if: ${{ always() }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: ⛔️ exit(1) on failure
|
|
if: ${{ contains(join(needs.*.result, ','), 'failure') }}
|
|
run: exit 1
|