Publish - #606 - mikealfare #205
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: "Pull request checks" | |
run-name: "Publish - #${{ github.event.number }} - ${{ github.actor }}" | |
on: | |
pull_request_target: | |
types: [opened, reopened, synchronize, labeled, unlabeled] | |
# only run this once per PR at a time | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.number }} | |
cancel-in-progress: true | |
jobs: | |
affected-packages: | |
runs-on: ubuntu-latest | |
outputs: | |
changelog-entry-check: ${{ steps.changelog-entry-check.outputs.changes }} | |
verify-build: ${{ steps.verify-build.outputs.changes }} | |
unit-tests: ${{ steps.unit-tests.outputs.changes }} | |
integration-tests: ${{ steps.integration-tests.outputs.changes }} | |
steps: | |
- id: changelog-entry-check | |
uses: dorny/paths-filter@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
filters: .github/filters/changelog-entry-check.yml | |
- id: verify-build | |
uses: dorny/paths-filter@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
filters: .github/filters/verify-build.yml | |
- id: unit-tests | |
uses: dorny/paths-filter@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
filters: .github/filters/unit-tests.yml | |
- id: integration-tests | |
uses: dorny/paths-filter@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
filters: .github/filters/integration-tests.yml | |
changelog-entry-check: | |
uses: ./.github/workflows/_changelog-entry-check.yml | |
needs: affected-packages | |
if: ${{ toJson(fromJson(needs.affected-packages.outputs.changelog-entry-check)) != '[]' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
package: ${{ fromJSON(needs.affected-packages.outputs.changelog-entry-check) }} | |
os: [ubuntu-22.04] | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
with: | |
package: "dbt-athena" | |
pull-request: ${{ github.event.pull_request.number }} | |
secrets: inherit | |
code-quality: | |
uses: ./.github/workflows/_code-quality.yml | |
with: | |
branch: ${{ github.event.pull_request.head.ref }} | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
verify-build: | |
uses: ./.github/workflows/_verify-build.yml | |
needs: affected-packages | |
if: ${{ toJson(fromJson(needs.affected-packages.outputs.verify-build)) != '[]' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
package: ${{ fromJSON(needs.affected-packages.outputs.verify-build) }} | |
os: [ubuntu-22.04] | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
with: | |
package: ${{ matrix.package }} | |
branch: ${{ github.event.pull_request.head.ref }} | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
os: ${{ matrix.os }} | |
python-version: ${{ matrix.python-version }} | |
unit-tests: | |
uses: ./.github/workflows/_unit-tests.yml | |
needs: affected-packages | |
if: ${{ toJson(fromJson(needs.affected-packages.outputs.unit-tests)) != '[]' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
package: ${{ fromJSON(needs.affected-packages.outputs.unit-tests) }} | |
os: [ ubuntu-22.04 ] | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
with: | |
package: ${{ matrix.package }} | |
branch: ${{ github.event.pull_request.head.ref }} | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
os: ${{ matrix.os }} | |
python-version: ${{ matrix.python-version }} | |
integration-tests: | |
uses: ./.github/workflows/_integration-tests.yml | |
needs: affected-packages | |
if: ${{ toJson(fromJson(needs.affected-packages.outputs.integration-tests)) != '[]' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
package: ${{ fromJSON(needs.affected-packages.outputs.integration-tests) }} | |
os: [ubuntu-22.04] | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
with: | |
package: ${{ matrix.package }} | |
branch: ${{ github.event.pull_request.head.ref }} | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
os: ${{ matrix.os }} | |
python-version: ${{ matrix.python-version }} | |
secrets: inherit | |
# This job does nothing and is only used for branch protection | |
results: | |
name: "Pull request checks" # keep this name, branch protection references it | |
if: always() | |
needs: [changelog-entry-check, code-quality, verify-build, unit-tests, integration-tests] | |
runs-on: ${{ vars.DEFAULT_RUNNER }} | |
steps: | |
- uses: re-actors/alls-green@release/v1 | |
with: | |
jobs: ${{ toJSON(needs) }} | |
allowed-skips: [unit-tests, integration-tests] |