-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move from Buildkite to GitHub Actions, attempt 2 #1127
Merged
Merged
Changes from 60 commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
469707c
First attempt at a GHA pipeline
74bef07
Provide dummy "run"; parameterize homeserver impl
4c86c1a
Try to force GHA to trigger in my fork
f68bbe4
correct yaml nesting; fix image name
6f8197f
Flesh out test cases and setup env
c4afc4f
GHA contexts require single quotes around strings
40e9979
Names are redundant: don't use `yes`
ed0d9d7
Maybe setting working dir will help?
3142295
Mount . as /sytest
f93a663
`.` was too short. Workspace as full path?
78814e0
Guess to try and fix the logs path
47ae955
single quotes :(
f9ac100
bash -xe for debug info
d87a25e
more -xe
1e98e8d
More exploratory debugging
4a66f6d
Try an explicit cat?
d87f6a8
Comment out to make the pipeline simpler
7436223
Where are we doing the tarring in?
1e8f5ad
synapse_sytest: use SYNAPSE_SOURCE throughout
04329ae
Can we get sytest running?
06f684b
stupid debug
bc453ba
desperation printf debugging
0567858
echo with quotes!?!?!
1171129
Remove bootstrap debug for now; mount /src
b8a7175
I think it'll be easier to concentrate on synapse
8ff4b2d
Again
5ed4665
Revert a bunch of incorrect changes; mkdir -p
2302479
Tweak pipeline
5aab2fe
Tweak checkout
ec135d6
Explicit paths
2f0c6d2
Fix blacklist path
cfb8729
Try to get sytest logs uploaded as artefacts
b78fad2
update TODOs; try more synapse testing
0862c20
Try to checkout the corresponding synapse branch
45cbb1a
Use rest API to avoid checkouts action retrying
ccd4e89
Need API token to make an API request hurrrr
7eafc11
Log annotation already handled by tap_to_gha.pl
66f1ac5
ci -> .ci
d2e27df
Remove backticks
58aabb9
dendrite
c74afbd
Fix docker volume cfg to mount dendrite
13f9000
I got lost in the yaml
bc2b9ce
Try to reduce annotation spam
aec7fa6
Okay, that didn't work because no curl
1a6a46c
Missing quote
cfda89b
Fix branches and apply to dendrite
0dc6a18
Oh, workers was an additional blacklist, not a replacement
03a59bf
Don't special case the github-actions branch
fd51fc4
Fix "fetch dendrite branch" step name
DMRobertson 2984f8f
Add explanatory comments
9e4a8f3
Try to get friendly job names
b5350ec
TEMP: hack in github-actions branch again
dd7b896
Fiddle with labels; include, `&& 1` for dendrite
06e00d5
Mark annotate.md as bk-specific
8589838
Shorten synapse labels
ea25d7a
More label faffing
7a9ca4b
Use BUILDKITE_LABEL for annotations again
0994d0c
Fix and improve handling of env vars
ce29fb2
More descriptive blacklist step name
5692410
We do actually want CI to pass a branch
eb6d227
Andrew's most recent review nits
a934a69
Don't pin version numbers for debian-testing
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
name: Run sytest | ||
on: | ||
push: | ||
branches: ["develop", "release-*", "github-actions"] | ||
pull_request: | ||
|
||
# Only run this action once per pull request/branch; restart if a new commit arrives. | ||
# C.f. https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency | ||
# and https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
synapse: | ||
name: "Synapse: ${{ matrix.label }}" | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- label: Py 3.6, SQLite, Monolith | ||
sytest-tag: bionic | ||
|
||
- label: Py 3.6, PG 10, Monolith | ||
sytest-tag: bionic | ||
postgres: postgres | ||
|
||
- label: Py 3.6, PG 10, Workers | ||
sytest-tag: bionic | ||
postgres: postgres | ||
workers: workers | ||
|
||
- label: Py 3.9, PG 13, Monolith | ||
sytest-tag: testing | ||
postgres: postgres | ||
|
||
- label: Py 3.9, PG 13, Workers | ||
sytest-tag: testing | ||
postgres: postgres | ||
workers: workers | ||
|
||
container: | ||
image: matrixdotorg/sytest-synapse:${{ matrix.sytest-tag }} | ||
volumes: | ||
# bootstrap.sh expects the sytest source available at /sytest. | ||
# TODO Buildkite mounted /sytest as readonly. Can we do this on GHA? Do we need it? | ||
- ${{ github.workspace }}/sytest:/sytest | ||
# synapse_sytest.sh expects a synapse checkout at /src | ||
- ${{ github.workspace }}/synapse:/src | ||
env: | ||
POSTGRES: ${{ matrix.postgres && 1 }} | ||
WORKERS: ${{ matrix.workers && 1 }} | ||
BLACKLIST: ${{ (matrix.workers && 'synapse-blacklist-with-workers') || 'sytest-blacklist' }} | ||
|
||
steps: | ||
- name: Checkout sytest | ||
uses: actions/checkout@v2 | ||
with: | ||
path: sytest | ||
|
||
- name: Fetch corresponding synapse branch | ||
shell: bash | ||
run: | | ||
BRANCH=${GITHUB_REF#refs/heads/} | ||
(wget -O - https://github.com/matrix-org/synapse/archive/$BRANCH.tar.gz || wget -O - https://github.com/matrix-org/synapse/archive/develop.tar.gz) \ | ||
| tar -xz --strip-components=1 -C /src/ | ||
|
||
- name: Prepare blacklist file for running with workers | ||
if: ${{ matrix.workers }} | ||
run: cat /src/sytest-blacklist /src/.ci/worker-blacklist > /src/synapse-blacklist-with-workers | ||
|
||
- name: Run sytest | ||
run: | | ||
echo POSTGRES=${POSTGRES:-<NOT SET>} | ||
echo WORKERS=${WORKERS:-<NOT SET>} | ||
echo BLACKLIST=${BLACKLIST:-<NOT SET>} | ||
bash -xe /bootstrap.sh synapse | ||
|
||
- name: Summarise results.tap | ||
# Use always() to run this step even if previous ones failed. | ||
if: ${{ always() }} | ||
run: /sytest/scripts/tap_to_gha.pl /logs/results.tap | ||
|
||
- name: Upload SyTest logs | ||
uses: actions/upload-artifact@v2 | ||
if: ${{ always() }} | ||
with: | ||
name: Sytest Logs - ${{ job.status }} - (Synapse, ${{ matrix.label }}) | ||
path: | | ||
/logs/results.tap | ||
/logs/**/*.log* | ||
|
||
dendrite: | ||
runs-on: ubuntu-latest | ||
name: "Dendrite: ${{ matrix.label }}" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- label: SQLite | ||
|
||
- label: SQLite, full HTTP APIs | ||
api: full-http | ||
|
||
- label: Postgres | ||
postgres: postgres | ||
|
||
- label: Postgres, full HTTP APIs | ||
postgres: postgres | ||
api: full-http | ||
|
||
container: | ||
image: matrixdotorg/sytest-dendrite | ||
volumes: | ||
# bootstrap.sh expects the sytest source available at /sytest. | ||
# TODO Buildkite mounted /sytest as readonly. Can we do this on GHA? Do we need it? | ||
- ${{ github.workspace }}/sytest:/sytest | ||
# synapse_sytest.sh expects a synapse checkout at /src | ||
- ${{ github.workspace }}/dendrite:/src | ||
env: | ||
POSTGRES: ${{ matrix.postgres && 1 }} | ||
API: ${{ matrix.api && 1 }} | ||
|
||
steps: | ||
- name: Checkout sytest | ||
uses: actions/checkout@v2 | ||
with: | ||
path: sytest | ||
|
||
- name: Fetch corresponding dendrite branch | ||
shell: bash | ||
run: | | ||
BRANCH=${GITHUB_REF#refs/heads/} | ||
(wget -O - https://github.com/matrix-org/dendrite/archive/$BRANCH.tar.gz || wget -O - https://github.com/matrix-org/dendrite/archive/master.tar.gz) \ | ||
| tar -xz --strip-components=1 -C /src/ | ||
|
||
- name: Run sytest | ||
run: | | ||
echo POSTGRES=${POSTGRES:-<NOT SET>} | ||
echo API=${API:-<NOT SET>} | ||
bash -xe /bootstrap.sh dendrite | ||
|
||
- name: Summarise results.tap | ||
if: ${{ always() }} | ||
run: /sytest/scripts/tap_to_gha.pl /logs/results.tap | ||
|
||
- name: Upload SyTest logs | ||
uses: actions/upload-artifact@v2 | ||
if: ${{ always() }} | ||
with: | ||
name: Sytest Logs - ${{ job.status }} - (Dendrite, ${{ join(matrix.*, ', ') }}) | ||
path: | | ||
/logs/results.tap | ||
/logs/**/*.log* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose we don't have a clear idea of postgres versions here as there's no distribution label for
sytest-dendrite
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sytest-dendrite:latest
looks to be based on Debian buster at the time of writing according todocker/build.sh:16
. I was a bit hesitant to write in a PG version for a tag that could change under our feet. But we already do this forsytest-synapse:testing
, based onsytest:testing
, based ondebian:testing
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, yeah. Actually, I suppose it might be a good idea to simply remove the version of
debian:testing
as well. I can't see us really remembering to ever update that version number...But one can check what it is if they really need to.