Skip to content

Commit

Permalink
#132: Updated GitHub workflows to request manual confirmation for ru…
Browse files Browse the repository at this point in the history
…nning slow tests (#136)

* #132: Updated GitHub workflows to request manual confirmation for running slow tests
  • Loading branch information
ckunki authored Jul 5, 2024
1 parent e425408 commit 8da3341
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 14 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,35 @@
name: Build and test project

on: [ push ]
on:
workflow_call:
inputs:
slow-tests:
type: boolean
default: false
python-version:
type: string
required: true

jobs:
build:
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
runs-on: ubuntu-20.04
environment: aws

steps:
- uses: actions/checkout@v3
- name: Set pytest markers
id: pytest-markers
if: ${{ ! inputs.slow-tests }}
run: echo slow-tests='-m "not slow"' >> "$GITHUB_OUTPUT"

- name: SCM Checkout
uses: actions/checkout@v4

- name: Setup Python & Poetry Environment
uses: ./.github/actions/prepare_poetry_env
with:
python-version: ${{ inputs.python-version }}

- name: Build Poetry
run: poetry build
Expand Down Expand Up @@ -43,4 +57,7 @@ jobs:
SAAS_HOST: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_HOST }}
SAAS_ACCOUNT_ID: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_ACCOUNT_ID }}
SAAS_PAT: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_PAT }}
run: poetry run pytest tests
PYTEST_ADDOPTS: '${{ steps.pytest-markers.outputs.slow-tests }}'
run: |
echo "PYTEST_ADDOPTS = $PYTEST_ADDOPTS"
poetry run pytest tests
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI

on:
pull_request:

jobs:

ci-job:
name: Fast Tests
strategy:
fail-fast: false
matrix:
python-version: [ "3.10" ]
uses: ./.github/workflows/build.yaml
secrets: inherit
with:
python-version: ${{ matrix.python-version }}
slow-tests: false

gate-1:
name: Gate 1 - Regular CI
needs: [ ci-job ]
runs-on: ubuntu-latest
steps:
- name: Branch Protection
run: true

slow-test-detection:
name: Run Slow or Expensive Tests?
runs-on: ubuntu-latest
steps:
- name: Detect Slow Tests
run: true
environment:
slow-tests

run-slow-tests:
name: Run Slow or Expensive Tests if Requested
uses: ./.github/workflows/build.yaml
needs: [ slow-test-detection ]
secrets: inherit
with:
slow-tests: true
python-version: "3.10"

gate-2:
name: Gate 2 - Allow Merge
runs-on: ubuntu-latest
needs: [ run-slow-tests ]
steps:
- name: Branch Protection
run: true
14 changes: 5 additions & 9 deletions doc/changes/changes_0.10.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,14 @@ Improving documentation, refactoring and moving to Python 3.10

### Features

- #120: Running CI tests in the SaaS as well as the Docker DB.

### Bug Fixes

n/a
* #120: Running CI tests in the SaaS as well as the Docker DB.

### Documentation

- #116: Explanation of how to from the S3 bucket URI

* #116: Explanation of how to from the S3 bucket URI

### Refactoring

- #118: Refactor to use python-extension-common package
- #124: Moved to Python 3.10
* #118: Refactor to use python-extension-common package
* #124: Moved to Python 3.10
* #132: Updated GitHub workflows to request manual confirmation for running slow tests

0 comments on commit 8da3341

Please sign in to comment.