@@ -21,124 +21,125 @@ runs:
21
21
image_var=$(echo ${{ inputs.project_name }}_IMAGE | tr '[:lower:]' '[:upper:]')
22
22
echo "${image_var}=${{ inputs.image_url }}" >> $GITHUB_ENV
23
23
24
- - name : Setup dev environment
25
- run : |
26
- pip install -r requirements-dev.txt
27
- echo "PY_COLORS=1" >> "$GITHUB_ENV"
28
- ### pytest-sentry configuration ###
29
- if [ "$GITHUB_REPOSITORY" = "getsentry/self-hosted" ]; then
30
- echo "PYTEST_SENTRY_DSN=$SELF_HOSTED_TESTING_DSN" >> $GITHUB_ENV
31
- echo "PYTEST_SENTRY_TRACES_SAMPLE_RATE=0" >> $GITHUB_ENV
24
+ - name : Setup dev environment
25
+ shell : bash
26
+ run : |
27
+ pip install -r requirements-dev.txt
28
+ echo "PY_COLORS=1" >> "$GITHUB_ENV"
29
+ ### pytest-sentry configuration ###
30
+ if [ "$GITHUB_REPOSITORY" = "getsentry/self-hosted" ]; then
31
+ echo "PYTEST_SENTRY_DSN=$SELF_HOSTED_TESTING_DSN" >> $GITHUB_ENV
32
+ echo "PYTEST_SENTRY_TRACES_SAMPLE_RATE=0" >> $GITHUB_ENV
32
33
33
- # This records failures on master to sentry in order to detect flakey tests, as it's
34
- # expected that people have failing tests on their PRs
35
- if [ "$GITHUB_REF" = "refs/heads/master" ]; then
36
- echo "PYTEST_SENTRY_ALWAYS_REPORT=1" >> $GITHUB_ENV
37
- fi
34
+ # This records failures on master to sentry in order to detect flakey tests, as it's
35
+ # expected that people have failing tests on their PRs
36
+ if [ "$GITHUB_REF" = "refs/heads/master" ]; then
37
+ echo "PYTEST_SENTRY_ALWAYS_REPORT=1" >> $GITHUB_ENV
38
38
fi
39
+ fi
39
40
40
- - name : Get Compose
41
- env :
42
- COMPOSE_PATH : /usr/local/lib/docker/cli-plugins
43
- COMPOSE_VERSION : ' v2.26.0'
44
- shell : bash
45
- run : |
46
- # Always remove `docker compose` support as that's the newer version
47
- # and comes installed by default nowadays.
48
- sudo rm -f "/usr/local/lib/docker/cli-plugins/docker-compose"
49
- # Docker Compose v1 is installed here, remove it
50
- sudo rm -f "/usr/local/bin/docker-compose"
51
- sudo rm -f "${{ env.COMPOSE_PATH }}/docker-compose"
52
- sudo mkdir -p "${{ env.COMPOSE_PATH }}"
53
- sudo curl -L https://github.com/docker/compose/releases/download/${{ env.COMPOSE_VERSION }}/docker-compose-`uname -s`-`uname -m` -o "${{ env.COMPOSE_PATH }}/docker-compose"
54
- sudo chmod +x "${{ env.COMPOSE_PATH }}/docker-compose"
41
+ - name : Get Compose
42
+ env :
43
+ COMPOSE_PATH : /usr/local/lib/docker/cli-plugins
44
+ COMPOSE_VERSION : " v2.26.0"
45
+ shell : bash
46
+ run : |
47
+ # Always remove `docker compose` support as that's the newer version
48
+ # and comes installed by default nowadays.
49
+ sudo rm -f "/usr/local/lib/docker/cli-plugins/docker-compose"
50
+ # Docker Compose v1 is installed here, remove it
51
+ sudo rm -f "/usr/local/bin/docker-compose"
52
+ sudo rm -f "${{ env.COMPOSE_PATH }}/docker-compose"
53
+ sudo mkdir -p "${{ env.COMPOSE_PATH }}"
54
+ sudo curl -L https://github.com/docker/compose/releases/download/${{ env.COMPOSE_VERSION }}/docker-compose-`uname -s`-`uname -m` -o "${{ env.COMPOSE_PATH }}/docker-compose"
55
+ sudo chmod +x "${{ env.COMPOSE_PATH }}/docker-compose"
55
56
56
- - name : Prepare Docker Volume Caching
57
- id : cache_key
58
- shell : bash
59
- run : |
60
- # Set permissions for docker volumes so we can cache and restore
61
- sudo chmod o+x /var/lib/docker
62
- sudo chmod -R o+rwx /var/lib/docker/volumes
63
- source .env
64
- SENTRY_IMAGE_SHA=$(docker buildx imagetools inspect $SENTRY_IMAGE --format "{{println .Manifest.Digest}}")
65
- echo "SENTRY_IMAGE_SHA=$SENTRY_IMAGE_SHA" >> $GITHUB_OUTPUT
66
- SNUBA_IMAGE_SHA=$(docker buildx imagetools inspect $SNUBA_IMAGE --format "{{println .Manifest.Digest}}")
67
- echo "SNUBA_IMAGE_SHA=$SNUBA_IMAGE_SHA" >> $GITHUB_OUTPUT
57
+ - name : Prepare Docker Volume Caching
58
+ id : cache_key
59
+ shell : bash
60
+ run : |
61
+ # Set permissions for docker volumes so we can cache and restore
62
+ sudo chmod o+x /var/lib/docker
63
+ sudo chmod -R o+rwx /var/lib/docker/volumes
64
+ source .env
65
+ SENTRY_IMAGE_SHA=$(docker buildx imagetools inspect $SENTRY_IMAGE --format "{{println .Manifest.Digest}}")
66
+ echo "SENTRY_IMAGE_SHA=$SENTRY_IMAGE_SHA" >> $GITHUB_OUTPUT
67
+ SNUBA_IMAGE_SHA=$(docker buildx imagetools inspect $SNUBA_IMAGE --format "{{println .Manifest.Digest}}")
68
+ echo "SNUBA_IMAGE_SHA=$SNUBA_IMAGE_SHA" >> $GITHUB_OUTPUT
68
69
69
- - name : Restore DB Volumes Cache
70
- id : restore_cache
71
- uses : actions/cache/restore@v4
72
- with :
73
- key : db-volumes-v4-${{ steps.cache_key.outputs.SENTRY_IMAGE_SHA }}-${{ steps.cache_key.outputs.SNUBA_IMAGE_SHA }}
74
- restore-keys : |
75
- db-volumes-v4-${{ steps.cache_key.outputs.SENTRY_IMAGE_SHA }}
76
- db-volumes-v4-
77
- path : |
78
- /var/lib/docker/volumes/sentry-postgres/_data
79
- /var/lib/docker/volumes/sentry-clickhouse/_data
80
- /var/lib/docker/volumes/sentry-kafka/_data
70
+ - name : Restore DB Volumes Cache
71
+ id : restore_cache
72
+ uses : actions/cache/restore@v4
73
+ with :
74
+ key : db-volumes-v4-${{ steps.cache_key.outputs.SENTRY_IMAGE_SHA }}-${{ steps.cache_key.outputs.SNUBA_IMAGE_SHA }}
75
+ restore-keys : |
76
+ db-volumes-v4-${{ steps.cache_key.outputs.SENTRY_IMAGE_SHA }}
77
+ db-volumes-v4-
78
+ path : |
79
+ /var/lib/docker/volumes/sentry-postgres/_data
80
+ /var/lib/docker/volumes/sentry-clickhouse/_data
81
+ /var/lib/docker/volumes/sentry-kafka/_data
81
82
82
- - name : Install self-hosted
83
- env :
84
- SKIP_DB_MIGRATIONS : ${{ steps.restore_cache.outputs.cache-hit == 'true' && '1' || '' }}
85
- shell : bash
86
- run : |
87
- # This is for the cache restore on Kafka to work in older releases
88
- docker run --rm -v "sentry-kafka:/data" busybox chown -R 1000:1000 /data
89
- # Add some customizations to test that path
90
- cat <<EOT >> sentry/enhance-image.sh
91
- #!/bin/bash
92
- touch /created-by-enhance-image
93
- apt-get update
94
- apt-get install -y gcc libsasl2-dev python-dev-is-python3 libldap2-dev libssl-dev
95
- EOT
96
- chmod 755 sentry/enhance-image.sh
97
- echo "python-ldap" > sentry/requirements.txt
83
+ - name : Install self-hosted
84
+ env :
85
+ SKIP_DB_MIGRATIONS : ${{ steps.restore_cache.outputs.cache-hit == 'true' && '1' || '' }}
86
+ shell : bash
87
+ run : |
88
+ # This is for the cache restore on Kafka to work in older releases
89
+ docker run --rm -v "sentry-kafka:/data" busybox chown -R 1000:1000 /data
90
+ # Add some customizations to test that path
91
+ cat <<EOT >> sentry/enhance-image.sh
92
+ #!/bin/bash
93
+ touch /created-by-enhance-image
94
+ apt-get update
95
+ apt-get install -y gcc libsasl2-dev python-dev-is-python3 libldap2-dev libssl-dev
96
+ EOT
97
+ chmod 755 sentry/enhance-image.sh
98
+ echo "python-ldap" > sentry/requirements.txt
98
99
99
- ./install.sh --no-report-self-hosted-issues --skip-commit-check
100
+ ./install.sh --no-report-self-hosted-issues --skip-commit-check
100
101
101
- - name : Prepare Docker Volume Caching
102
- shell : bash
103
- run : |
104
- # Set permissions for docker volumes so we can cache and restore
105
- # We need these for the backup/restore test snapshotting too
106
- sudo chmod o+x /var/lib/docker
107
- sudo chmod -R o+rx /var/lib/docker/volumes
108
- # Set tar ownership for it to be able to read
109
- # From: https://github.com/actions/toolkit/issues/946#issuecomment-1726311681
110
- sudo chown root /usr/bin/tar && sudo chmod u+s /usr/bin/tar
111
- sudo chown root /usr/bin/rsync && sudo chmod u+s /usr/bin/rsync
102
+ - name : Prepare Docker Volume Caching
103
+ shell : bash
104
+ run : |
105
+ # Set permissions for docker volumes so we can cache and restore
106
+ # We need these for the backup/restore test snapshotting too
107
+ sudo chmod o+x /var/lib/docker
108
+ sudo chmod -R o+rx /var/lib/docker/volumes
109
+ # Set tar ownership for it to be able to read
110
+ # From: https://github.com/actions/toolkit/issues/946#issuecomment-1726311681
111
+ sudo chown root /usr/bin/tar && sudo chmod u+s /usr/bin/tar
112
+ sudo chown root /usr/bin/rsync && sudo chmod u+s /usr/bin/rsync
112
113
113
- - name : Save DB Volumes Cache
114
- if : steps.restore_cache.outputs.cache-hit != 'true'
115
- uses : actions/cache/save@v4
116
- with :
117
- key : ${{ steps.restore_cache.outputs.cache-primary-key }}
118
- path : |
119
- /var/lib/docker/volumes/sentry-postgres/_data
120
- /var/lib/docker/volumes/sentry-clickhouse/_data
121
- /var/lib/docker/volumes/sentry-kafka/_data
114
+ - name : Save DB Volumes Cache
115
+ if : steps.restore_cache.outputs.cache-hit != 'true'
116
+ uses : actions/cache/save@v4
117
+ with :
118
+ key : ${{ steps.restore_cache.outputs.cache-primary-key }}
119
+ path : |
120
+ /var/lib/docker/volumes/sentry-postgres/_data
121
+ /var/lib/docker/volumes/sentry-clickhouse/_data
122
+ /var/lib/docker/volumes/sentry-kafka/_data
122
123
123
- - name : Integration Test
124
- shell : bash
125
- run : |
126
- rsync -aW --no-compress --mkpath \
127
- /var/lib/docker/volumes/sentry-postgres \
128
- /var/lib/docker/volumes/sentry-clickhouse \
129
- /var/lib/docker/volumes/sentry-kafka \
130
- "$RUNNER_TEMP/volumes/"
131
- docker compose up --wait
132
- pytest -x --cov --junitxml=junit.xml _integration-test/
124
+ - name : Integration Test
125
+ shell : bash
126
+ run : |
127
+ rsync -aW --no-compress --mkpath \
128
+ /var/lib/docker/volumes/sentry-postgres \
129
+ /var/lib/docker/volumes/sentry-clickhouse \
130
+ /var/lib/docker/volumes/sentry-kafka \
131
+ "$RUNNER_TEMP/volumes/"
132
+ docker compose up --wait
133
+ pytest -x --cov --junitxml=junit.xml _integration-test/
133
134
134
- - name : Upload coverage to Codecov
135
- uses : codecov/codecov-action@v5
136
- with :
137
- token : ${{ secrets.CODECOV_TOKEN }}
138
- slug : getsentry/self-hosted
135
+ - name : Upload coverage to Codecov
136
+ uses : codecov/codecov-action@v5
137
+ with :
138
+ token : ${{ secrets.CODECOV_TOKEN }}
139
+ slug : getsentry/self-hosted
139
140
140
- - name : Upload test results to Codecov
141
- if : ${{ !cancelled() }}
142
- uses : codecov/test-results-action@v1
143
- with :
144
- token : ${{ secrets.CODECOV_TOKEN }}
141
+ - name : Upload test results to Codecov
142
+ if : ${{ !cancelled() }}
143
+ uses : codecov/test-results-action@v1
144
+ with :
145
+ token : ${{ secrets.CODECOV_TOKEN }}
0 commit comments