CI - run jobs only on push or PR from forks

This commit is contained in:
Sam 2023-10-04 10:38:22 +02:00
parent 172faf48d6
commit e75a7f3f9d
2 changed files with 10 additions and 2 deletions

View File

@ -5,12 +5,14 @@ on:
paths: ['fittrackee_client/**']
pull_request:
paths: ['fittrackee_client/**']
types: [opened, synchronize, reopened]
env:
working-directory: fittrackee_client
jobs:
javascript:
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.fork }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

View File

@ -2,9 +2,10 @@ name: Python CI
on:
push:
paths-ignore: ['docs/**', 'docsrc/**', 'fittrackee_client/**', '*.md']
paths-ignore: ['docs/**', 'docsrc/**', 'docker/**', 'fittrackee_client/**', '*.md']
pull_request:
paths-ignore: ['docs/**', 'docsrc/**', 'fittrackee_client/**', '*.md']
paths-ignore: ['docs/**', 'docsrc/**', 'docker/**', 'fittrackee_client/**', '*.md']
types: [opened, synchronize, reopened]
env:
APP_SETTINGS: fittrackee.config.TestingConfig
@ -15,6 +16,7 @@ env:
jobs:
python:
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.fork }}
name: python ${{ matrix.python-version }} (postgresql 15)
runs-on: ubuntu-latest
container: python:${{ matrix.python-version }}
@ -57,6 +59,7 @@ jobs:
run: pytest fittrackee -p no:warnings --cov fittrackee --cov-report term-missing --maxfail=1
postgresql:
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.fork }}
name: postgresql ${{ matrix.psql-version }} (python 3.11)
runs-on: ubuntu-latest
container: python:3.11
@ -87,6 +90,7 @@ jobs:
run: pytest fittrackee -p no:warnings --cov fittrackee --cov-report term-missing --maxfail=1
end2end:
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.fork }}
name: e2e tests
runs-on: ubuntu-latest
needs: ["python"]
@ -132,6 +136,7 @@ jobs:
pytest e2e --driver Remote --capability browserName firefox --selenium-host selenium --selenium-port 4444 --maxfail=1
end2end_package:
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.fork }}
name: e2e tests with package
runs-on: ubuntu-latest
needs: ["python"]
@ -185,6 +190,7 @@ jobs:
pytest e2e --driver Remote --capability browserName firefox --selenium-host selenium --selenium-port 4444 --maxfail=1
end2end_package_update:
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.fork }}
name: e2e tests after update
runs-on: ubuntu-latest
needs: ["python"]