-
-
Notifications
You must be signed in to change notification settings - Fork 49
130 lines (113 loc) · 3.58 KB
/
Copy pathprobe.yml
File metadata and controls
130 lines (113 loc) · 3.58 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Compatibility tests
on:
workflow_dispatch:
inputs:
test_count:
type: number
default: 1000
description: Number of mods to test
required: true
tag:
type: string
description: Target release tag
env:
TEST_COUNT: ${{ inputs.test_count }}
GATHERER_IMG: ghcr.io/sinytra/probe/gatherer:latest
jobs:
run_tests:
name: Run tests
runs-on: ubuntu-latest
services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
--name probe_redis
ports:
- 6379:6379
permissions:
contents: write
packages: read
steps:
- name: Setup env
run: mkdir probe
- name: Restore cached test data
uses: tespkg/actions-cache/restore@v1
with:
accessKey: ${{ secrets.S3_ACCESS_KEY }}
secretKey: ${{ secrets.S3_SECRET_KEY }}
bucket: ${{ secrets.S3_BUCKET_NAME }}
use-fallback: false
key: ${{ runner.os }}-cache
path: |
probe/.setup
probe/mods
probe/candidates.json
probe/dump.rdb
- name: Restore redis data
if: ${{ hashFiles('probe/dump.rdb') != '' }}
run: |
docker stop probe_redis
docker cp probe/dump.rdb probe_redis:/data/dump.rdb
docker start probe_redis
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests in a container
run: >
docker run --rm
--network host
-v ./probe:/probe
-e REDIS_URL=redis://localhost:6379/0
-e TEST_COUNT=${{ env.TEST_COUNT }}
-e FORCE_RETAKE_TESTS=true
-e CLEANUP_OUTPUT=true
-e TOOLCHAIN_VERSION=${{ inputs.tag || github.ref_name }}
${{ env.GATHERER_IMG }}
run
- name: Backup redis data
run: |
docker stop probe_redis
docker cp probe_redis:/data/dump.rdb probe/dump.rdb
- name: Upload report
if: ${{ hashFiles('probe/report.md') != '' }}
run: cat probe/report.md >> $GITHUB_STEP_SUMMARY
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: test-results
path: probe/results.json
- name: Upload release assets
uses: softprops/action-gh-release@v2
if: ${{ inputs.tag != '' || github.ref_type == 'tag' }}
with:
tag_name: ${{ inputs.tag || github.ref_name }}
files: probe/results.json
- name: Upload results to Probe
run: |
curl -X POST --location "${{ vars.PROBE_API_URL }}/api/v1/internal/import" \
-H "Authorization: Bearer ${{ secrets.PROBE_API_KEY }}" \
-H "Content-Type: application/json" \
-d @probe/results.json
- name: Redeploy Probe web
run: |
curl -d "" -X POST ${{ secrets.PROBE_WEB_DEPLOY_HOOK }}
- name: Save cached test data
uses: tespkg/actions-cache/save@v1
with:
accessKey: ${{ secrets.S3_ACCESS_KEY }}
secretKey: ${{ secrets.S3_SECRET_KEY }}
bucket: ${{ secrets.S3_BUCKET_NAME }}
use-fallback: false
key: ${{ runner.os }}-cache
path: |
probe/.setup
probe/mods
probe/candidates.json
probe/dump.rdb