-
Notifications
You must be signed in to change notification settings - Fork 12
97 lines (84 loc) · 2.5 KB
/
test.yml
File metadata and controls
97 lines (84 loc) · 2.5 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: test
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
checks: write
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
bash: [bash, bash3.2]
name: test (bash ${{ matrix.bash == 'bash' && '5' || '3.2' }})
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: docker/setup-buildx-action@v3
- name: Build test image
uses: docker/build-push-action@v6
with:
context: .
file: test/Dockerfile
load: true
tags: tmux-assistant-resurrect-test
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Run tests
run: |
mkdir -p test-results
docker run --rm \
-e TEST_BASH=${{ matrix.bash }} \
-v ${{ github.workspace }}/test-results:/tmp/test-results \
tmux-assistant-resurrect-test
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: test-results/junit.xml
comment_mode: off
check_name: tests (${{ matrix.bash == 'bash' && 'bash 5' || 'bash 3.2' }})
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: docker/setup-buildx-action@v3
- name: Build test image
uses: docker/build-push-action@v6
with:
context: .
file: test/Dockerfile
load: true
tags: tmux-assistant-resurrect-test
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Prepare benchmark baseline
run: |
git fetch origin main --depth=1
git worktree add /tmp/benchmark-base origin/main
- name: Run benchmark matrix
run: |
mkdir -p test-results
bash test/bench-matrix.sh \
--head-repo "${GITHUB_WORKSPACE}" \
--base-repo /tmp/benchmark-base \
--runs 5 \
--output-csv test-results/benchmark.csv \
--output-md test-results/benchmark.md
cat test-results/benchmark.md >>"${GITHUB_STEP_SUMMARY}"
- name: Upload benchmark results
uses: actions/upload-artifact@v4
if: always()
with:
name: benchmark-results
if-no-files-found: warn
path: |
test-results/benchmark.csv
test-results/benchmark.md