-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (31 loc) · 996 Bytes
/
pr.yml
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
name: PR Checks
on:
pull_request:
types: [opened, reopened, synchronize, labeled]
jobs:
pr_checks:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install Poetry
run: pip install poetry
- name: Install dependencies
run: poetry install
- name: Check for 'safe to deploy' label
id: check_label
run: |
if [[ ${{ contains(github.event.pull_request.labels.*.name, 'safe to deploy') }} == 'true' ]]; then
echo "safe_to_deploy=true" >> $GITHUB_OUTPUT
else
echo "safe_to_deploy=false" >> $GITHUB_OUTPUT
fi
- name: Run pre-deployment tests
if: steps.check_label.outputs.safe_to_deploy == 'true'
run: poetry run pytest tests --ignore=tests/test_modal.py