-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
127 lines (111 loc) · 3.8 KB
/
test.yml
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
name: Test
on:
# Run CI on all pushes to the master and release/** branches, and on all new
# pull requests, and on all pushes to pull requests (even if a pull request
# is not against master).
push:
branches:
- "master"
- "release/**"
pull_request:
schedule:
- cron: "0 0,12 * * *"
concurrency:
group: ${{ github.ref_name || github.sha }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
unit-test:
if: github.repository_owner == 'getsentry'
runs-on: ubuntu-22.04
name: "unit tests"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Compose
uses: ./get-compose-action
- name: Unit Tests
run: ./unit-test.sh
upgrade-test:
if: github.repository_owner == 'getsentry'
runs-on: ubuntu-22.04
name: "Sentry upgrade test"
env:
REPORT_SELF_HOSTED_ISSUES: 0
steps:
- name: Get latest self-hosted release version
run: |
LATEST_TAG=$(curl -s https://api.github.com/repos/getsentry/self-hosted/releases/latest | jq -r '.tag_name')
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
- name: Get Compose
uses: getsentry/self-hosted/get-compose-action@master
- name: Checkout latest release
uses: actions/checkout@v4
with:
ref: ${{ env.LATEST_TAG }}
- name: Restore DB Volumes Cache
id: restore_cache
uses: BYK/docker-volume-cache-action/restore@be89365902126f508dcae387a32ec3712df6b1cd
with:
key: db-volumes-v6-${{ env.LATEST_TAG }}
restore-keys: |
db-volumes-v6-${{ env.LATEST_TAG }}
db-volumes-v6-
volumes: |
sentry-postgres
sentry-clickhouse
sentry-kafka
- name: Install ${{ env.LATEST_TAG }}
env:
# Remove SKIP_DB_MIGRATIONS after releasing 25.1.1 or 25.2.0
SKIP_DB_MIGRATIONS: ${{ steps.restore_cache.outputs.cache-hit == 'true' && '1' || '' }}
SKIP_SENTRY_MIGRATIONS: ${{ steps.restore_cache.outputs.cache-hit == 'true' && '1' || '' }}
SKIP_SNUBA_MIGRATIONS: ${{ steps.restore_cache.outputs.cache-hit == 'true' && '1' || '' }}
run: |
# This is to compensate for a bug in upgrade-clickhouse where
# if we have sentry-clickhouse volume without the rest, it fails
# We may get sentry-clickhouse from the cache step above
source install/create-docker-volumes.sh
./install.sh
- name: Save DB Volumes Cache
if: steps.restore_cache.outputs.cache-hit != 'true'
uses: BYK/docker-volume-cache-action/save@be89365902126f508dcae387a32ec3712df6b1cd
with:
key: ${{ steps.restore_cache.outputs.cache-primary-key }}
volumes: |
sentry-postgres
sentry-clickhouse
sentry-kafka
- name: Checkout current ref
uses: actions/checkout@v4
- name: Install current ref
run: |
# This is for the cache restore on Kafka to work in older releases
docker run --rm -v "sentry-kafka:/data" busybox chown -R 1000:1000 /data
./install.sh
- name: Inspect failure
if: failure()
run: |
docker compose ps
docker compose logs
integration-test:
if: github.repository_owner == 'getsentry'
runs-on: ubuntu-22.04
name: integration test
env:
REPORT_SELF_HOSTED_ISSUES: 0
SELF_HOSTED_TESTING_DSN: ${{ vars.SELF_HOSTED_TESTING_DSN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use action from local checkout
uses: './'
with:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Inspect failure
if: failure()
run: |
docker compose ps
docker compose logs