-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (45 loc) · 1.38 KB
/
ci-integration.yml
File metadata and controls
48 lines (45 loc) · 1.38 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
45
46
47
48
name: Integration CI
on:
push:
branches: [main, master]
workflow_dispatch:
jobs:
check-cooldown:
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.check.outputs.should_run }}
steps:
- name: Check cooldown
id: check
env:
GH_TOKEN: ${{ github.token }}
run: |
LAST_RUN=$(gh run list --workflow "${{ github.workflow }}" --status completed --limit 1 --json updatedAt -q '.[0].updatedAt' || echo "")
if [ -z "$LAST_RUN" ]; then
echo "should_run=true" >> $GITHUB_OUTPUT
else
LAST_RUN_EPOCH=$(date -d "$LAST_RUN" +%s)
NOW_EPOCH=$(date +%s)
DIFF=$(( NOW_EPOCH - LAST_RUN_EPOCH ))
if [ $DIFF -ge 10800 ]; then
echo "should_run=true" >> $GITHUB_OUTPUT
else
echo "should_run=false" >> $GITHUB_OUTPUT
fi
fi
integration-tests:
needs: check-cooldown
if: needs.check-cooldown.outputs.should_run == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
enable-cache: true
cache-dependency-path: uv.lock
- name: Install dependencies
run: uv sync
- name: Run integration tests
run: ./scripts/run_integration_tests.sh