From f7f7e9186408f137b3cb622e385830a0148c0014 Mon Sep 17 00:00:00 2001 From: Artem Kislovskiy Date: Sat, 13 Apr 2024 14:45:55 +0200 Subject: [PATCH] run actions on pull request --- .github/workflows/2023-PyConIT-workflow.yaml | 41 +++++++++++-------- ...023-PyData_Berlin-python-pdf-workflow.yaml | 40 ++++++++++++------ .../workflows/2023_EuroSciPy_workflow.yaml | 33 +++++++++------ 3 files changed, 74 insertions(+), 40 deletions(-) diff --git a/.github/workflows/2023-PyConIT-workflow.yaml b/.github/workflows/2023-PyConIT-workflow.yaml index 94dbb7d..21af3c4 100644 --- a/.github/workflows/2023-PyConIT-workflow.yaml +++ b/.github/workflows/2023-PyConIT-workflow.yaml @@ -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 @@ -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 }} @@ -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 }} @@ -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 }} diff --git a/.github/workflows/2023-PyData_Berlin-python-pdf-workflow.yaml b/.github/workflows/2023-PyData_Berlin-python-pdf-workflow.yaml index 9a083ca..fc839c2 100644 --- a/.github/workflows/2023-PyData_Berlin-python-pdf-workflow.yaml +++ b/.github/workflows/2023-PyData_Berlin-python-pdf-workflow.yaml @@ -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 @@ -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 }} @@ -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 }} @@ -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 }} diff --git a/.github/workflows/2023_EuroSciPy_workflow.yaml b/.github/workflows/2023_EuroSciPy_workflow.yaml index f8e7f24..d5432c7 100644 --- a/.github/workflows/2023_EuroSciPy_workflow.yaml +++ b/.github/workflows/2023_EuroSciPy_workflow.yaml @@ -1,20 +1,11 @@ -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: @@ -22,6 +13,25 @@ defaults: 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 }} @@ -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