Skip to content

Commit

Permalink
Add 2024_PyConDE workflows (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kislovskiy authored Apr 15, 2024
2 parents b50b185 + 1b07ae2 commit 839f9c5
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 10 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/2023-PyConIT-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ jobs:
timeout-minutes: 1
permissions:
pull-requests: read
outputs:
changes: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
if: github.ref == 'refs/heads/main' # Only checkout when the branch is 'main'
- name: Check for backend file changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 #v3.0.2
id: changes
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/2023-PyData_Berlin-python-pdf-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,19 @@ jobs:
permissions:
pull-requests: read
outputs:
changes: ${{ steps.filter.outputs.changes }}
PyDataBerlinChanges: ${{ steps.filter.outputs.PyDataBerlinChanges }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Check for backend file changes
if: github.ref == 'refs/heads/main' # Only checkout when the branch is 'main'
- name: Check for 2023_PyData_Berlin file changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 #v3.0.2
id: changes
id: filter
with:
filters: |
changes:
PyDataBerlinChanges:
- "2023_PyData_Berlin/**/*.py"
- "2023_PyData_Berlin/**/*.ipynb"
- "2023_PyData_berlin/requirements.txt"
- "2023_PyData_Berlin/requirements.txt"
lint:
name: 🚨 Lint Python code
Expand All @@ -59,7 +60,7 @@ jobs:

test:
name: 🕵 Test Python code
if: needs.changes.outputs.changes == 'true'
if: ${{ needs.changes.outputs.PyDataBerlinChanges == 'true' }}
needs: changes
runs-on: ubuntu-latest
steps:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/2023_EuroSciPy_workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ jobs:
timeout-minutes: 1
permissions:
pull-requests: read
outputs:
changes: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
if: github.ref == 'refs/heads/main' # Only checkout when the branch is 'main'
- name: Check for backend file changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 #v3.0.2
id: changes
Expand All @@ -34,6 +33,8 @@ jobs:
- "2023_EuroSciPy/requirements.txt"
build:
name: 🏗️ Build with Python ${{ matrix.python-version }} on ${{ matrix.os }}
needs: changes
if: needs.changes.outputs.changes == 'true'
runs-on: ${{ matrix.os }}

strategy:
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/2024_PyConDE_explore_default_shell.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "2024 PyCON DE 🔬 Show Default Shell"
run-name: "MANUAL - 🔬 Show Default Shell (run by - ${{ github.triggering_actor }})"

on:
workflow_dispatch:

jobs:
show_default_shell:
runs-on: ubuntu-latest

steps:
- name: Display Default Shell
run: echo "Default Shell $SHELL"
13 changes: 13 additions & 0 deletions .github/workflows/2024_PyConDE_explore_environemnt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "2024 PyCON DE 🔬 Show Default Env"
run-name: "MANUAL - 🔬 Show Default Env (run by - ${{ github.triggering_actor }})"

on:
workflow_dispatch:

jobs:
show_default_shell:
runs-on: ubuntu-latest

steps:
- name: Display Environment
run: printenv
33 changes: 33 additions & 0 deletions .github/workflows/2024_PyConDE_random_generator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "2024 PyCON DE 🎲 Random Number Workflow"
run-name: "MANUAL - 🔬 Show Default Env (run by - ${{ github.triggering_actor }})"

on:
workflow_dispatch:

jobs:
random-number-generator:
runs-on: ubuntu-latest
outputs:
number: ${{ steps.generate-number.outputs.number }}
is-even: ${{ steps.generate-number.outputs.is-even }}
steps:
- id: generate-number
run: echo "number=$(echo $RANDOM)" >> "$GITHUB_OUTPUT"
- id: is-even
run: |
echo "is-even=$(( ${{steps.generate-number.outputs.number}} % 2 == 0 ))" >> "$GITHUB_OUTPUT"
echo "The number is ${{steps.generate-number.outputs.number}}" >> $GITHUB_STEP_SUMMARY
consumer-of-generator-odd:
needs: random-number-generator
runs-on: ubuntu-latest
if: ${{ needs.random-number-generator.outputs.is-even == 0 }}
steps:
- run: echo "The number is ${{ needs.random-number-generator.outputs.number }} is odd"

consumer-of-generator-even:
needs: random-number-generator
runs-on: ubuntu-latest
if: ${{ needs.random-number-generator.outputs.is-even == 1 }}
steps:
- run: echo "The number is ${{ needs.random-number-generator.outputs.number }} is even"
18 changes: 18 additions & 0 deletions .github/workflows/2024_PyConDE_reusable_workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "2024 PyCON DE ♻️ My Reusable Workflow"
run-name: "MANUAL - ♻️ My Reusable Workflow (run by - ${{ github.triggering_actor }})"

on:
workflow_call:
inputs:
example_param:
description: 'An example input parameter'
required: true
default: 'Hello, World! (default) 😞'
type: string

jobs:
my_job:
runs-on: ubuntu-latest
steps:
- name: Output Input Parameter
run: echo "The input parameter value is ${{ inputs.example_param }}"
11 changes: 11 additions & 0 deletions .github/workflows/2024_PyConDE_trigger_workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: "2024 PyCON DE ♻️ Trigger Reusable Workflow"
run-name: "MANUAL - ♻️ Trigger Reusable Workflow (run by - ${{ github.triggering_actor }})"

on:
workflow_dispatch:

jobs:
trigger_workflow:
uses: Kislovskiy/talks/.github/workflows/2024_PyConDE_reusable_workflow.yaml@github-acitons-playground
with:
example_param: 'Hello, World! 😀'

0 comments on commit 839f9c5

Please sign in to comment.