Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/GitHub actions pr draft #1008

Merged
merged 19 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: dist

on:
# Manual trigger option in github
# Manual trigger option in GitHub
workflow_dispatch:

# Trigger on push to these branches
Expand All @@ -10,14 +10,20 @@ on:
- main
- development

# Trigger on a open/push to a PR targeting one of these branches
# Trigger on open/push to a PR targeting one of these branches
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
branches:
- main
- development

jobs:
dist:
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest

steps:
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: docs

on:
# Manual trigger option in github
# This won't push to github pages where docs are hosted due
# to the gaurded if statement in those steps
# Manual trigger option in GitHub
# This won't push to GitHub pages where docs are hosted due
# to the guarded if statement in those steps
workflow_dispatch:

# Trigger on push to these branches
Expand All @@ -12,8 +12,13 @@ on:
- main
- development

# Trigger on a open/push to a PR targeting one of these branches
# Trigger on open/push to a PR targeting one of these branches
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
branches:
- main
- development
Expand All @@ -23,6 +28,7 @@ env:

jobs:
build-and-deploy:
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: pre-commit

on:
# Manually triggerable in github
# Manually triggerable in GitHub
workflow_dispatch:

# When a push occurs on either of these branches
Expand All @@ -12,12 +12,18 @@ on:

# When a push occurs on a PR that targets these branches
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
branches:
- main
- development

jobs:
run-all-files:
if : ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest

steps:
Expand Down
27 changes: 18 additions & 9 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: tests

on:
# Allow to manually trigger through github API
# Allow to manually trigger through GitHub API
workflow_dispatch:

# Triggers with push to main
Expand All @@ -12,6 +12,11 @@ on:

# Triggers with push to a pr aimed at main
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
branches:
- main
- development
Expand All @@ -34,6 +39,7 @@ jobs:
# General unit tests
source-test:
name: ${{ matrix.python-version }}-${{ matrix.os }}
if: ${{ !github.event.pull_request.draft }}

runs-on: ${{ matrix.os }}
defaults:
Expand All @@ -44,7 +50,6 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
# python-version: ["3.8"]
os: ["ubuntu-latest"]

steps:
Expand All @@ -70,10 +75,10 @@ jobs:

- name: Tests
run: |
pytest ${{ env.pytest-args }} ${{ env.test-dir }}

# Post-hoc clean-up
make clean
echo "Running all tests..."
pytest ${{ env.pytest-args }} ${{ env.test-dir }}
# Post-hoc clean-up
make clean

- name: Check for files left behind by test
run: |
Expand All @@ -89,6 +94,7 @@ jobs:
# Testing with conda
conda-tests:
name: conda-${{ matrix.python-version }}-${{ matrix.os }}
if: ${{ !github.event.pull_request.draft }}
runs-on: ${{ matrix.os }}
defaults:
run:
Expand All @@ -98,7 +104,6 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
# python-version: ["3.8"]
os: ["ubuntu-latest"]

steps:
Expand All @@ -120,11 +125,15 @@ jobs:

- name: Tests
run: |
pytest ${{ env.pytest-args }} ${{ env.test-dir }}
echo "Running all tests..."
pytest ${{ env.pytest-args }} ${{ env.test-dir }}



# Testing a dist install
dist-test:
name: dist-${{ matrix.python-version }}-${{ matrix.os }}
if: ${{ !github.event.pull_request.draft }}

runs-on: ${{ matrix.os }}
defaults:
Expand All @@ -135,7 +144,6 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
# python-version: ["3.8"]
os: ["ubuntu-latest"]

steps:
Expand All @@ -161,4 +169,5 @@ jobs:

- name: Tests
run: |
echo "Running all tests..."
pytest ${{ env.pytest-args }} ${{ env.test-dir }}