Skip to content

Commit

Permalink
update main test to ignore pytest if PR is from fork
Browse files Browse the repository at this point in the history
  • Loading branch information
ajshedivy committed Aug 8, 2024
1 parent b7ec117 commit 3e2d27b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ jobs:
run: |
echo "is_fork=${{ github.event.pull_request.head.repo.fork }}" >> $GITHUB_ENV
- name: Run only if from fork
- name: check if PR is from a fork
if: env.is_fork == 'true'
run: echo "This PR is from a fork. Running specific actions."
run: echo "This PR is from a fork. skipping pyest."

- name: Skip if not from fork
if: env.is_fork != 'true'
run: echo "This PR is not from a fork. Skipping specific actions."
run: echo "This PR is not from a fork. Running pytest."

- name: Restore mypy cache
if: matrix.task.name == 'Type check'
Expand All @@ -99,7 +99,8 @@ jobs:
mypy-${{ env.CACHE_PREFIX }}-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('*requirements.txt') }}-${{ github.ref }}
mypy-${{ env.CACHE_PREFIX }}-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('*requirements.txt') }}
- name: ${{ matrix.task.name }}
- name: Run Python tests
if: env.is_fork != 'true' && matrix.task.name == 'Test'
run: |
. .venv/bin/activate
${{ matrix.task.run }}
Expand All @@ -108,6 +109,12 @@ jobs:
VITE_DB_USER: ${{ secrets.VITE_DB_USER }}
VITE_DB_PASS: ${{ secrets.VITE_DB_PASS }}

- name: ${{ matrix.task.name }}
if: matrix.task.name != 'Test'
run: |
. .venv/bin/activate
${{ matrix.task.run }}
- name: Upload package distribution files
if: matrix.task.name == 'Build'
uses: actions/upload-artifact@v3
Expand Down

0 comments on commit 3e2d27b

Please sign in to comment.