Merge pull request #177 from pact-foundation/stan-is-hate-can-i-merge… #458
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: Test | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby_version: ["2.7", "3.0", "3.1", "3.2", "3.3"] | |
os: ["ubuntu-latest","windows-latest","macos-latest"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby_version }} | |
- run: "bundle install" | |
- run: "bundle exec rake" | |
pact: | |
runs-on: "ubuntu-latest" | |
continue-on-error: true | |
strategy: | |
fail-fast: false | |
matrix: | |
feature: [""] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: "3.2" | |
- run: "bundle install" | |
# Publish to old and new account until we can disable the old account | |
- name: Generate and publish pacts | |
run: | | |
rm -rf spec/pacts/* | |
bundle exec rspec spec/service_providers/ | |
bundle exec rake pact:publish:pactflow_pact_foundation | |
env: | |
PACT_BROKER_TOKEN_PACT_FOUNDATION: ${{ secrets.PACT_BROKER_TOKEN_PACT_FOUNDATION }} | |
PACT_BROKER_FEATURES: ${{ matrix.feature }} | |
TEST_FEATURE: ${{ matrix.feature }} | |
can-i-deploy: | |
runs-on: "ubuntu-latest" | |
needs: pact | |
steps: | |
- run: | | |
docker run --rm \ | |
-e PACT_BROKER_BASE_URL=https://pact-foundation.pactflow.io \ | |
-e PACT_BROKER_TOKEN \ | |
pactfoundation/pact-cli:latest \ | |
broker can-i-deploy \ | |
--pacticipant "Pact Broker Client" --version ${GITHUB_SHA} \ | |
--pacticipant "Pact Broker" --branch master | |
env: | |
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN_PACT_FOUNDATION }} |