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

View File

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