1
0
Fork 0
bag-of-tricks/.forgejo/workflows/ci.yml
Marc Cataford a9a81176c9
All checks were successful
/ pre-run-notify (push) Successful in 31s
/ sast (push) Successful in 1m16s
/ post-run-notify (push) Successful in 34s
ci: replace pipx calls with community actions
2024-07-24 21:24:00 -04:00

54 lines
1.9 KiB
YAML

on:
push:
jobs:
pre-run-notify:
runs-on: ubuntu-latest
steps:
- uses: https://forge.karnov.club/marc/push-status-to-discord-action@main
id: post-status
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
status: "Started"
- run: echo ${{ steps.post-status.outputs.message-id }} >> /tmp/discord-message-id
- uses: https://code.forgejo.org/forgejo/upload-artifact@v4
with:
path: /tmp/discord-message-id
name: "${{ github.sha }}-${{ github.run_number }}-discord-message-id"
overwrite: true
sast:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Check formatting
uses: https://github.com/psf/black@stable
with:
options: "--check --verbose"
version: "~= 24.0"
- name: Check import ordering
uses: https://github.com/isort/isort-action@v1
post-run-notify:
runs-on: ubuntu-latest
if: always()
steps:
- uses: https://code.forgejo.org/forgejo/download-artifact@v4
with:
name: "${{ github.sha }}-${{ github.run_number }}-discord-message-id"
path: /tmp
- id: get-discord-message-id
run: echo "message-id=$(cat /tmp/discord-message-id)" >> $GITHUB_OUTPUT
- uses: https://forge.karnov.club/marc/push-status-to-discord-action@main
if: ${{ success() }}
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
variant: "success"
status: "Success"
message-id: ${{ steps.get-discord-message-id.outputs.message-id }}
- uses: https://forge.karnov.club/marc/push-status-to-discord-action@main
if: ${{ failure() }}
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
variant: "failure"
status: "Failure"
message-id: ${{ steps.get-discord-message-id.outputs.message-id }}