-
Notifications
You must be signed in to change notification settings - Fork 3
60 lines (50 loc) · 1.4 KB
/
test.yml
File metadata and controls
60 lines (50 loc) · 1.4 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
49
50
51
52
53
54
55
56
57
58
59
60
name: test
run-name: tests by @${{ github.actor }}
on:
pull_request:
branches: [main]
push:
branches: [main]
permissions:
contents: read
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
jobs:
unit:
name: Unit tests (bats)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Install yq
run: |
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
sudo chmod +x /usr/local/bin/yq
- name: Run unit tests
run: make test-unit
lint:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Run shellcheck
run: shellcheck --severity=error src/crabcode
ci-success:
name: CI Success
runs-on: ubuntu-latest
needs: [unit, lint]
# The shared action waits for all PR checks on this commit; on push to main
# it can also pick up unrelated branch checks (for example Dependabot).
if: ${{ always() && github.event_name == 'pull_request' }}
timeout-minutes: 5
permissions:
checks: read
statuses: read
steps:
- name: Wait for all PR checks to succeed
uses: promptfoo/.github/.github/actions/ci-success@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
timeout-seconds: 300