Test the filters workflow
This commit is contained in:
parent
5f5fc0d150
commit
04cf47b32d
@ -3,12 +3,27 @@ run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
|||||||
on: [push]
|
on: [push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
changes:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
python_files: ${{ steps.filter.outputs.python_files }}
|
||||||
|
helm_files: ${{ steps.filter.outputs.helm }}
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- uses: dorny/paths-filter@v3
|
||||||
|
id: filter
|
||||||
|
with:
|
||||||
|
filters: |
|
||||||
|
python_files:
|
||||||
|
- 'app/**'
|
||||||
|
helm:
|
||||||
|
- 'helm/**'
|
||||||
Lint-Python:
|
Lint-Python:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.python_files == 'true' }}
|
||||||
steps:
|
steps:
|
||||||
- run: echo "This is run ${{ gitea.run_id }}"
|
|
||||||
# - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
|
||||||
# - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- uses: dorny/paths-filter@v3
|
- uses: dorny/paths-filter@v3
|
||||||
@ -20,13 +35,15 @@ jobs:
|
|||||||
- name: install UV
|
- name: install UV
|
||||||
run: |
|
run: |
|
||||||
pip install uv --quiet
|
pip install uv --quiet
|
||||||
if: steps.filter.outputs.workflows == 'true'
|
if: steps.filter.outputs.python_files == 'true'
|
||||||
- name: install black and lint code
|
- name: install black and lint code
|
||||||
run: |
|
run: |
|
||||||
uv pip install black --system --quiet
|
uv pip install black --system --quiet
|
||||||
black app --check --fast
|
black app --check --fast
|
||||||
if: steps.filter.outputs.workflows == 'true'
|
if: steps.filter.outputs.python_files == 'true'
|
||||||
Build-and-Push-Docker:
|
Build-and-Push-Docker:
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.python_files == 'true' }}
|
||||||
steps:
|
steps:
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
@ -44,9 +61,3 @@ jobs:
|
|||||||
tags: |
|
tags: |
|
||||||
dragon-bot/dale-bot:latest
|
dragon-bot/dale-bot:latest
|
||||||
dragon-bot/dale-bot:${{ gitea.run_id }}
|
dragon-bot/dale-bot:${{ gitea.run_id }}
|
||||||
# - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
|
||||||
# - run: echo "🖥️ The workflow is now ready to test your code on the runner."
|
|
||||||
# - name: List files in the repository
|
|
||||||
# run: |
|
|
||||||
# ls ${{ gitea.workspace }}
|
|
||||||
# - run: echo "🍏 This job's status is ${{ job.status }}."
|
|
Loading…
x
Reference in New Issue
Block a user