Skip to content

ci: Pass github.workspace to reusable workflow #119

ci: Pass github.workspace to reusable workflow

ci: Pass github.workspace to reusable workflow #119

Workflow file for this run

name: "Build and Test"
on:
pull_request:
branches:
- 'main'
push:
branches:
- 'main'
- 'chore/**'
- 'docs/**'
- 'feat/**'
- 'feature/**'
- 'fix/**'
- 'refactor/**'
- 'releases/**'
- 'style/**'
- 'test/**'
- 'tech/**'
env:
RUST_TARGET_PATH: pact-reference/rust/target
BINARIES_PATH: Resources
CACHE_KEY: build-ffi-rust
CACHE_RESTORE_KEY: build-ffi-rust
jobs:
sharedInputs:
name: "🔣 Shared envs"
runs-on: ubuntu-latest
outputs:
rust-target-path: ${{ env.RUST_TARGET_PATH }}
binaries-path: ${{ env.BINARIES_PATH }}
cache-key: ${{ env.CACHE_KEY }}
cache-restore-key: ${{ env.CACHE_RESTORE_KEY }}
steps:
- run: echo "Just a hacky workaround for passing envs to jobs expecting them... ¯\_(ツ)_/¯"
buildFFI:
name: "📦 Dependencies"
needs: [sharedInputs]
uses: ./.github/workflows/build_rust_binaries.yml
with:
rust-target-path: ${{ needs.sharedInputs.outputs.rust-target-path }}
binaries-path: ${{ needs.sharedInputs.outputs.binaries-path }}
cache-key: ${{ needs.sharedInputs.outputs.cache-key }}
cache-restore-key: ${{ needs.sharedInputs.outputs.cache-restore-key }}
testMacOS14:
name: "🤖 Unit tests"
needs: [sharedInputs, buildFFI]
uses: ./.github/workflows/test_macos14_arm64.yml
secrets:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
with:
rust-target-path: ${{ needs.sharedInputs.outputs.rust-target-path }}
binaries-path: ${{ needs.sharedInputs.outputs.binaries-path }}
cache-key: ${{ needs.sharedInputs.outputs.cache-key }}
cache-restore-key: ${{ needs.sharedInputs.outputs.cache-restore-key }}
testMacOS13:
name: "🤖 Unit tests"
needs: [sharedInputs, buildFFI]
uses: ./.github/workflows/test_macos13_x86_64.yml
with:
rust-target-path: ${{ needs.sharedInputs.outputs.rust-target-path }}
binaries-path: ${{ needs.sharedInputs.outputs.binaries-path }}
cache-key: ${{ needs.sharedInputs.outputs.cache-key }}
cache-restore-key: ${{ needs.sharedInputs.outputs.cache-restore-key }}