Skip to content

Commit

Permalink
Only skip checks on pull requests to ensure that we always build cach…
Browse files Browse the repository at this point in the history
…es that are accessible for all PRs.
  • Loading branch information
rtibbles committed Sep 30, 2023
1 parent 4bc79f9 commit f9af2e4
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/c_extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
c_ext:
name: C Extensions
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
runs-on: ubuntu-20.04
container:
image: python:2.7.18-buster
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
no_c_ext:
name: No C Extensions
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
runs-on: ubuntu-20.04
container:
image: python:2.7.18-buster
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
docs:
name: Checking docs build
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_licenses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
licenses:
name: Licenses check
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/no_zombies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
zombies:
name: No zombies
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
linting:
name: All file linting
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python2lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
lint:
name: Python 2 syntax checking
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
runs-on: ubuntu-20.04
container:
image: python:2.7.18-buster
Expand Down
36 changes: 18 additions & 18 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
run: |
python -m pip install --upgrade pip
pip install "tox<4"
- name: tox env cache
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.tox/py${{ matrix.python-version }}
key: ${{ runner.os }}-tox-py${{ matrix.python-version }}-${{ hashFiles('requirements/*.txt') }}
- name: Test with tox
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
run: tox -e py${{ matrix.python-version }}
unit_test27:
name: Python unit tests (2.7)
Expand All @@ -62,18 +62,18 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install tox
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
run: |
python -m pip install --upgrade pip
pip install "tox<4"
- name: tox env cache
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.tox/py2.7
key: ${{ runner.os }}-tox-py2.7-${{ hashFiles('requirements/*.txt') }}
- name: Test with tox
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
run: tox -e py2.7
postgres:
name: Python postgres unit tests
Expand Down Expand Up @@ -101,23 +101,23 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9 for Postgres
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install tox
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
run: |
python -m pip install --upgrade pip
pip install "tox<4"
- name: tox env cache
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.tox/py3.9
key: ${{ runner.os }}-tox-py3.9-${{ hashFiles('requirements/*.txt') }}
- name: Test with tox
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
run: tox -e postgres
macos:
name: Python unit tests on Mac OS
Expand All @@ -131,23 +131,23 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
run: |
python -m pip install --upgrade pip
pip install "tox<4"
- name: tox env cache
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.tox/py${{ matrix.python-version }}
key: ${{ runner.os }}-tox-py${{ matrix.python-version }}-${{ hashFiles('requirements/*.txt') }}
- name: Test with tox
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
run: tox -e py${{ matrix.python-version }}
windows:
name: Python unit tests on Windows Server
Expand All @@ -161,15 +161,15 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
run: |
python -m pip install --upgrade pip
pip install "tox<4"
- name: Test with tox
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
run: tox -e py${{ matrix.python-version }}
2 changes: 1 addition & 1 deletion .github/workflows/yarn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
test:
name: Frontend tests
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down

0 comments on commit f9af2e4

Please sign in to comment.