Skip to content

Commit

Permalink
ci: add pact to ci pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Sep 13, 2024
1 parent 18a7e23 commit 5264fbe
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/build-test-cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ jobs:
with:
useConfigFile: true
configFilePath: ./.github/gitversion.yml

- uses: pactflow/actions/can-i-deploy@auto_detect_version_branch
with:
to_environment: production
application_name: explore-cli
broker_url: ${{ secrets.PACT_BROKER_BASE_URL }}
token: ${{ secrets.PACT_BROKER_TOKEN }}
- name: Download artifacts
uses: actions/download-artifact@v4

Expand All @@ -131,4 +138,11 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: artifact/*
file_glob: true
tag: ${{ steps.gitversion.outputs.MajorMinorPatch }}
tag: ${{ steps.gitversion.outputs.MajorMinorPatch }}

- uses: pactflow/actions/record-release@auto_detect_version_branch
with:
environment: production
application_name: explore-cli
PACT_BROKER_BASE_URL: ${{ secrets.PACT_BROKER_BASE_URL }}
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }}
13 changes: 13 additions & 0 deletions .github/workflows/build-test-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,19 @@ jobs:
dotnet test
working-directory: test/Explore.Cli.Tests

- uses: pactflow/actions/publish-pact-files@auto_detect_version_branch
with:
pactfiles: test/Explore.Cli.Tests/pacts
broker_url: ${{ secrets.PACT_BROKER_BASE_URL }}
token: ${{ secrets.PACT_BROKER_TOKEN }}

- uses: pactflow/actions/can-i-deploy@auto_detect_version_branch
with:
to_environment: production
application_name: explore-cli
broker_url: ${{ secrets.PACT_BROKER_BASE_URL }}
token: ${{ secrets.PACT_BROKER_TOKEN }}

- name: Create Package
run: dotnet pack --configuration $BUILD_CONFIG -o:package /p:PackageVersion=${{ steps.gitVersion.outputs.assemblySemVer }}
working-directory: src/Explore.Cli
Expand Down

0 comments on commit 5264fbe

Please sign in to comment.