ci: Pass github.workspace to reusable workflow #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Build and Test" | |
on: | |
push: | |
branches: | |
- '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 }} | |
submit-coverage-report: false | |
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 }} |