-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (37 loc) · 940 Bytes
/
code-checks.yaml
File metadata and controls
41 lines (37 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Run code quality checks
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
code-quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- uses: yezz123/setup-uv@v4
- run: uv sync
- name: Run linter
run: ./lint.sh
- name: Run tests
run: uv run pytest tests/ -v
notify-on-failure:
name: Notify on Code Quality Failures
if: ${{ failure() && github.ref == 'refs/heads/main' }}
needs:
- code-quality
runs-on: ubuntu-latest
steps:
- uses: nobrayner/discord-webhook@v1
with:
github-token: ${{ secrets.github_token }}
discord-webhook: ${{ secrets.DISCORD_WEBHOOK }}
title: 'LazyGithub Code Quality Checks Failed'
description: 'There are linter errors on main!'