-
Notifications
You must be signed in to change notification settings - Fork 7
44 lines (42 loc) · 1.33 KB
/
ci.yml
File metadata and controls
44 lines (42 loc) · 1.33 KB
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
42
43
44
name: CI
on:
push:
branches: [main]
pull_request_target:
workflow_dispatch:
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# make sure we have a branch when triggered by pull_request (ie: avoids a detached HEAD)
ref: ${{ github.head_ref }}
- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Test
run: make -B test
- name: Update snapshots
run: |
git config user.name snapshots
git config user.email snapshots@users.noreply.github.com
git status
# debug https://github.com/tekumara/python-typed-template/issues/126
git ls-remote
git add .
if git commit -m "chore: update snapshots"; then
git push
fi
- name: Check branch name
run: |
BRANCH_NAME="${{ github.head_ref }}"
if [[ "$BRANCH_NAME" == *"dependabot"* ]]; then
echo "Fail to allow debugging"
exit 1
fi
- name: Start sshx session on failed manual run or retry
if: ${{ failure() && (github.event_name == 'workflow_dispatch' || github.run_attempt > 1) }}
run: curl -sSf https://sshx.io/get | sh && sshx