From 9a6b33c4d751cac4c0e8cb519248e4f995c9e7ce Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Sat, 2 Nov 2024 18:32:25 -0400 Subject: [PATCH] ci: run pre-commit steps as CI checks --- .forgejo/workflows/pull-request.yml | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .forgejo/workflows/pull-request.yml diff --git a/.forgejo/workflows/pull-request.yml b/.forgejo/workflows/pull-request.yml new file mode 100644 index 0000000..36d1baf --- /dev/null +++ b/.forgejo/workflows/pull-request.yml @@ -0,0 +1,32 @@ +on: [pull_request] + +jobs: + static-analysis: + runs-on: runner-latest + steps: + - uses: actions/checkout@v4 + - name: Linting + run: pipx run pre-commit run ruff -a + - name: Format + run: pipx run pre-commit run ruff-format -a + - name: Validate Yaml + run: pipx run pre-commit run check-yaml -a + - name: Validate shell scripts + run: pipx run pre-commit run shellcheck -a + tests: + runs-on: runner-latest + steps: + - uses: actions/checkout@v4 + - name: Tests + run: pipx run pre-commit run pytest + export-trace: + runs-on: runner-latest + needs: [static-analysis] + steps: + - uses: https://forge.karnov.club/marc/opentelemetry-trace-export-forgejo-action@main + with: + otlp-endpoint: "http://otel.home.karnov.club:4318" + forgejo-token: ${{ secrets.GITHUB_TOKEN }} + forgejo-base-url: ${{ env.GITHUB_SERVER_URL }} + run-id: ${{ env.GITHUB_RUN_NUMBER }} + repo-name: ${{ env.GITHUB_REPOSITORY }}