Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: skip contract tests if CI or doc changes #112

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,27 @@ jobs:
run: nox --session=lint

test:
outputs:
previous_revision: ${{ steps.app.outputs.previous_revision }}
revision: ${{ steps.app.outputs.revision }}
env:
ALLURE_RESULTS: allure-results
ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }}
name: Test Code
runs-on: ubuntu-20.04
steps:
- id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.PUBLIC_RELEASE_MANAGER_ID }}
private-key: ${{ secrets.PUBLIC_RELEASE_MANAGER_SECRET }}
- name: Checkout PR branch
uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
ref: ${{ github.head_ref }}
fetch-depth: 50
fetch-tags: true
- name: Setup Python
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -70,7 +83,18 @@ jobs:
run: allurectl watch -- nox --session=tests
- name: Build package wheel
run: poetry build
- name: Check commit eligibility
uses: commitizen-tools/commitizen-action@master
with:
github_token: ${{ github.token }}
push: false
- name: get app revision
id: app
run: |
echo "previous_revision=$PREVIOUS_REVISION" >> $GITHUB_OUTPUT
echo "revision=$REVISION" >> $GITHUB_OUTPUT
- name: Publish pact
if: ${{ steps.app.outputs.previous_revision != steps.app.outputs.revision }}
run: make -f pact.mk publish_pacts
- name: get allure_run_id
if: always()
Expand All @@ -82,6 +106,7 @@ jobs:
name: Check compatibility with SatVu APIs
runs-on: ubuntu-latest
needs: test
if: ${{ needs.test.outputs.previous_revision != needs.test.outputs.revision }}
steps:
- uses: actions/checkout@v4
- run: docker pull pactfoundation/pact-cli:latest
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/tag-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
with:
token: ${{ steps.app-token.outputs.token }}
ref: ${{ github.event.repository.default_branch }}
# `fetch-depth` > 0 is required to have `ref` have an effect
fetch-depth: 999
fetch-tags: true
- id: bump
Expand Down Expand Up @@ -88,16 +87,27 @@ jobs:
record_release_pact:
name: Record release in pactflow
needs:
- tag
- release
runs-on: ubuntu-latest
steps:
- name: Checkout PR branch
uses: actions/checkout@v4
- id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.PUBLIC_RELEASE_MANAGER_ID }}
private-key: ${{ secrets.PUBLIC_RELEASE_MANAGER_SECRET }}
- uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
ref: ${{ github.event.repository.default_branch }}
# `fetch-depth` > 0 is required to have `ref` have an effect
fetch-depth: 999
fetch-tags: true
- name: Mark release in Pactflow 🚀
env:
ENVIRONMENT: production
GH_TOKEN: ${{ github.token }}
GIT_BRANCH: ${{ github.ref_name }}
GIT_BRANCH: ${{ github.event.repository.default_branch }}
PACT_BROKER_BASE_URL: ${{ secrets.PACT_BROKER_BASE_URL }}
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }}
VERSION: ${{ needs.tag.outputs.version }}
Expand Down
Loading
Loading