Skip to content

Commit

Permalink
Run Actions on Pull Requests (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kislovskiy authored Apr 13, 2024
2 parents fc8fd54 + f7f7e91 commit 3357a87
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 40 deletions.
41 changes: 25 additions & 16 deletions .github/workflows/2023-PyConIT-workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
name: "2023 PyConIT 🇮🇹 generate gallery.pdf"
run-name: "️2023 PyConIT 🇮🇹 (${{ github.sha }})"
run-name: "️BUILD - 2023 PyConIT (${{ github.event_name }})"

on:
pull_request:
paths:
- "2023_PyConIT/**/*.py"
- "2023_PyConIT/**/*.ipynb"
- "2023_PyData_berlin/requirements.txt"
push:
paths:
- "2023_PyConIT/**/*.py"
- "2023_PyConIT/**/*.ipynb"
- "2023_PyData_berlin/requirements.txt"
branches:
- main
workflow_dispatch:

env:
PYTHON_VERSION: 3.11
Expand All @@ -25,14 +16,34 @@ defaults:
shell: bash -el {0}

jobs:
changes:
name: 🔄 Check out changes
runs-on: ubuntu-latest
timeout-minutes: 1
permissions:
pull-requests: read
outputs:
changes: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Check for backend file changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 #v3.0.2
id: changes
with:
filters: |
changes:
- "2023_PyConIT/**/*.py"
- "2023_PyConIT/**/*.ipynb"
- "2023_PyConIT/requirements.txt"
lint:
name: 🚨 Lint Python code
if: needs.changes.outputs.changes == 'true'
needs: changes
runs-on: ubuntu-latest
steps:
- name: Setup Python environment
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 1
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ env.PYTHON_VERSION }}
Expand All @@ -48,12 +59,12 @@ jobs:

test:
name: 🕵 Test Python code
if: needs.changes.outputs.changes == 'true'
needs: changes
runs-on: ubuntu-latest
steps:
- name: Setup Python environment
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ env.PYTHON_VERSION }}
Expand All @@ -70,8 +81,6 @@ jobs:
steps:
- name: Setup Python environment
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ env.PYTHON_VERSION }}
Expand Down
40 changes: 28 additions & 12 deletions .github/workflows/2023-PyData_Berlin-python-pdf-workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: "2023 PyData Berlin 🇩🇪 generate gallery.pdf"
run-name: "️2023 PyData Berlin 🇩🇪 (${{ github.sha }})"
run-name: "BUILD - 2023 PyData Berlin (${{ github.event_name }})"

on:
pull_request:
push:
paths:
- "2023_PyData_Berlin/**/*.py"
- "2023_PyData_Berlin/**/*.ipynb"
- "2023_PyData_berlin/requirements.txt"
workflow_dispatch:
branches:
- main

env:
PYTHON_VERSION: 3.11
Expand All @@ -18,14 +16,34 @@ defaults:
shell: bash -el {0}

jobs:
changes:
name: 🔄 Check out changes
runs-on: ubuntu-latest
timeout-minutes: 1
permissions:
pull-requests: read
outputs:
changes: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Check for backend file changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 #v3.0.2
id: changes
with:
filters: |
changes:
- "2023_PyData_Berlin/**/*.py"
- "2023_PyData_Berlin/**/*.ipynb"
- "2023_PyData_berlin/requirements.txt"
lint:
name: 🚨 Lint Python code
if: needs.changes.outputs.changes == 'true'
needs: changes
runs-on: ubuntu-latest
steps:
- name: Setup Python environment
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 1
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ env.PYTHON_VERSION }}
Expand All @@ -41,12 +59,12 @@ jobs:

test:
name: 🕵 Test Python code
if: needs.changes.outputs.changes == 'true'
needs: changes
runs-on: ubuntu-latest
steps:
- name: Setup Python environment
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ env.PYTHON_VERSION }}
Expand All @@ -63,8 +81,6 @@ jobs:
steps:
- name: Setup Python environment
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ env.PYTHON_VERSION }}
Expand Down
33 changes: 21 additions & 12 deletions .github/workflows/2023_EuroSciPy_workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
name: "2023 EuroSciPy 🇨🇭Continuous Integration Demo"
run-name: "️2023 EuroSciPy CI (${{ github.sha }})"
name: "2023 EuroSciPy 🇨🇭 Continuous Integration Demo"
run-name: "️BUILD - 2023 EuroSciPy (${{ github.event_name }})"

on:
pull_request:
paths:
- "2023_EuroSciPy/**/*.py"
- "2023_EuroSciPy/**/*.ipynb"
- "2023_EuroSciPy/pyproject.toml"
push:
paths:
- "2023_EuroSciPy/**/*.py"
- "2023_EuroSciPy/**/*.ipynb"
- "2023_EuroSciPy/pyproject.toml"
branches:
- main
workflow_dispatch:

defaults:
run:
# Use Bash shell with 'errexit' option to exit immediately if any command fails.
shell: bash -e {0}

jobs:
changes:
name: 🔄 Check out changes
runs-on: ubuntu-latest
timeout-minutes: 1
permissions:
pull-requests: read
outputs:
changes: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Check for backend file changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 #v3.0.2
id: changes
with:
filters: |
changes:
- "2023_EuroSciPy/**/*.py"
- "2023_EuroSciPy/**/*.ipynb"
- "2023_EuroSciPy/requirements.txt"
build:
name: 🏗️ Build with Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand All @@ -35,7 +45,6 @@ jobs:
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 1
sparse-checkout: 2023_EuroSciPy
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
Expand Down

0 comments on commit 3357a87

Please sign in to comment.