Skip to content

Remove dependency on pytest-freezegun plugin #2231

Remove dependency on pytest-freezegun plugin

Remove dependency on pytest-freezegun plugin #2231

Workflow file for this run

name: PR
on:
pull_request_target:
types:
- opened
- synchronize
- ready_for_review
- labeled
jobs:
env: # setup shared env
runs-on: ubuntu-latest
permissions: { }
outputs:
python-version: '3.8'
source-ref: refs/pull/${{github.event.pull_request.number}}/merge
steps:
- run: echo done
changes: # detect changes
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
src: ${{ steps.filter.outputs.src }}
scripts: ${{ steps.filter.outputs.scripts }}
doc: ${{ steps.filter.outputs.doc }}
build: ${{ steps.filter.outputs.build }}
steps:
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
src:
- '.github/workflows/pytest.yml'
- '.github/workflows/guitest.yml'
- '.github/workflows/coverage.yml'
- '.github/actions/**'
- 'src/**'
- 'requirements*'
scripts:
- '.github/workflows/scripttest.yml'
- '.github/actions/**'
- 'scripts/**'
- 'src/**'
- 'requirements*'
doc:
- '.github/workflows/documentation.yml'
- '.github/actions/**'
- 'doc/**'
- 'src/**'
- 'requirements*'
build:
- '.github/workflows/build*.yml'
- '.github/actions/**'
- 'build/**'
- 'src/**'
- 'requirements*'
gatekeeper: # check user's permissions
runs-on: ubuntu-latest
permissions: read-all
steps:
- name: Check if PR has label
id: label_check
uses: docker://agilepathway/pull-request-label-checker:v1.2.9
with:
one_of: 'PR: safe to check'
repo_token: ${{ secrets.GITHUB_TOKEN }}
allow_failure: true
- name: Check if user has write access
if: steps.label_check.outputs.label_check == 'failure'
uses: lannonbr/repo-permission-check-action@2bb8c89ba8bf115c4bfab344d6a6f442b24c9a1f
with:
permission: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# ----------------------------------------------------------------------------
# PR stage: Draft
# coverage:
# needs: [ changes, gatekeeper, env ]
# if: ${{ needs.changes.outputs.src == 'true' }}
# uses: ./.github/workflows/coverage.yml
# secrets:
# PYTEST_SENTRY_DSN: ${{secrets.PYTEST_SENTRY_DSN}}
# CODACY_PROJECT_TOKEN: ${{secrets.CODACY_PROJECT_TOKEN}}
# with:
# python-version: ${{needs.env.outputs.python-version}}
# ref: ${{needs.env.outputs.source-ref}}
#
# guitest:
# needs: [ changes, gatekeeper, env ]
# if: ${{ needs.changes.outputs.src == 'true' }}
# uses: ./.github/workflows/guitest.yml
# secrets:
# PYTEST_SENTRY_DSN: ${{secrets.PYTEST_SENTRY_DSN}}
# with:
# python-version: ${{needs.env.outputs.python-version}}
# matrix: '{"os": ["windows-latest"]}'
# ref: ${{needs.env.outputs.source-ref}}
#
# scripttest:
# needs: [ changes, env ]
# if: ${{ needs.changes.outputs.scripts == 'true' }}
# uses: ./.github/workflows/scripttest.yml
# with:
# python-version: ${{needs.env.outputs.python-version}}
# ref: ${{needs.env.outputs.source-ref}}
# ----------------------------------------------------------------------------
# PR stage: Ready
pytest:
needs: [ changes, gatekeeper, env ]
# if: ${{needs.changes.outputs.src == 'true' && github.event.pull_request.draft}}
uses: ./.github/workflows/pytest.yml
secrets:
PYTEST_SENTRY_DSN: ${{secrets.PYTEST_SENTRY_DSN}}
with:
python-version: ${{needs.env.outputs.python-version}}
matrix: '{"os": ["windows-latest", "macos-latest"]}'
ref: ${{needs.env.outputs.source-ref}}
# guitest_nix:
# needs: [ changes, gatekeeper, env ]
# if: ${{needs.changes.outputs.src == 'true' && !github.event.pull_request.draft}}
# uses: ./.github/workflows/guitest.yml
# secrets:
# PYTEST_SENTRY_DSN: ${{secrets.PYTEST_SENTRY_DSN}}
# with:
# python-version: ${{needs.env.outputs.python-version}}
# matrix: '{"os": ["ubuntu-latest", "macos-latest"]}'
# ref: ${{needs.env.outputs.source-ref}}
# build binaries
# ubuntu:
# needs: [ changes, env ]
# if: ${{needs.changes.outputs.build == 'true' && !github.event.pull_request.draft}}
# uses: ./.github/workflows/build_ubuntu.yml
# with:
# upload: false
# os: ubuntu-latest
# python-version: ${{needs.env.outputs.python-version}}
# ref: ${{needs.env.outputs.source-ref}}
#
# mac:
# needs: [ changes, env ]
# if: ${{needs.changes.outputs.build == 'true' && !github.event.pull_request.draft}}
# uses: ./.github/workflows/build_mac.yml
# with:
# upload: false
# os: macos-latest
# python-version: ${{needs.env.outputs.python-version}}
# ref: ${{needs.env.outputs.source-ref}}
#
# windows:
# needs: [ changes, env ]
# if: ${{needs.changes.outputs.build == 'true' && !github.event.pull_request.draft}}
# uses: ./.github/workflows/build_windows.yml
# with:
# upload: false
# os: windows-latest
# python-version: ${{needs.env.outputs.python-version}}
# ref: ${{needs.env.outputs.source-ref}}
#
# # check documentation build
# documentation:
# needs: [ changes, env ]
# if: ${{needs.changes.outputs.doc == 'true' && !github.event.pull_request.draft}}
# uses: ./.github/workflows/documentation.yml
# with:
# python-version: ${{needs.env.outputs.python-version}}
# ref: ${{needs.env.outputs.source-ref}}