This repository was archived by the owner on Mar 26, 2024. It is now read-only.
forked from matrix-org/synapse
-
Notifications
You must be signed in to change notification settings - Fork 2
173 lines (156 loc) · 5.31 KB
/
beeper-ci.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: Beep
on:
push:
branches: ["beeper", "beeper-*"]
pull_request:
jobs:
lint-style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: pip install poetry
- run: poetry install
- run: poetry run isort --check synapse
- run: poetry run black --check synapse
lint-types:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: pip install poetry
- run: poetry install --extras all
- run: poetry run mypy
# Tests
test-trial:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: pip install poetry
- run: poetry install --extras all
- run: poetry run trial -j4 tests
test-sytest:
runs-on: ubuntu-latest
container:
image: matrixdotorg/sytest-synapse:buster
volumes:
- ${{ github.workspace }}:/src
env:
SYTEST_BRANCH: ${{ github.head_ref }}
TOP: ${{ github.workspace }}
POSTGRES: 1
MULTI_POSTGRES: 1
WOKRERS: 1
steps:
- uses: actions/checkout@v2
- name: Run SyTest
run: /bootstrap.sh synapse
working-directory: /src
- 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 }} - (${{ join(matrix.*, ', ') }})
path: |
/logs/results.tap
/logs/**/*.log*
test-complement:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
with:
repository: matrix-org/complement
path: complement
ref: db970e4aa66828b28f2252ee87ea3bd917f25865
# Hack: remove the partial state join tests which are flakey and known to be upstream, we don't
# want them causingo our tests to fail all the time.
- name: Remove flakey TestPartialStateJoin tests
run: |-
rm -f complement/tests/federation_room_join_partial_state_test.go
- name: Install complement dependencies
run: |-
sudo apt-get -qq update
sudo apt-get install -qqy libolm3 libolm-dev
go install -v github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
- name: Run Complement
run: ./scripts-dev/complement.sh
env:
COMPLEMENT_DIR: complement
WORKERS: 1
POSTGRES: 1
# Builds
build-python:
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 1
steps:
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ${{ secrets.CI_REGISTRY }}
username: ${{ secrets.CI_REGISTRY_USER }}
password: ${{ secrets.CI_REGISTRY_PASSWORD }}
- run: |-
if [ "${{ github.ref_name }}" = "beeper" ]; then
tag=$(cat pyproject.toml | grep -E "^version =" | sed -E 's/^version = "(.+)"$/\1/')
extraTag="--tag ${{ secrets.CI_REGISTRY }}/synapse:latest"
else
tag="${{ github.head_ref || github.ref_name }}"
extraTag=""
fi
docker buildx build \
--push \
--platform linux/amd64 \
--tag ${{ secrets.CI_REGISTRY }}/synapse:$tag-${{ github.sha }} \
$extraTag \
-f docker/Dockerfile \
.
# Ensure the image works properly
docker run \
--entrypoint '' \
${{ secrets.CI_REGISTRY }}/synapse:$tag-${{ github.sha }} \
python -m synapse.app.homeserver --help
echo "Pushed image: synapse:$tag-${{ github.sha }}"
if [ "${{ github.ref_name }}" = "beeper" ]; then
echo "Pushed image: synapse:latest"
fi
build-pyston:
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 1
steps:
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ${{ secrets.CI_REGISTRY }}
username: ${{ secrets.CI_REGISTRY_USER }}
password: ${{ secrets.CI_REGISTRY_PASSWORD }}
- run: |-
if [ "${{ github.ref_name }}" = "beeper" ]; then
tag=$(cat pyproject.toml | grep -E "^version =" | sed -E 's/^version = "(.+)"$/\1/');
else
tag="${{ github.head_ref || github.ref_name }}";
fi
docker buildx build \
--push \
--platform linux/amd64 \
--build-arg PYTHON_PREFIX=/usr \
--build-arg BASE_IMAGE=${{ secrets.CI_REGISTRY }}/pyston-no-pymalloc:slim-amd64-2.3.4 \
--tag ${{ secrets.CI_REGISTRY }}/synapse:$tag-${{ github.sha }}-pyston \
-f docker/Dockerfile \
.
# Ensure the image works properly
docker run \
--entrypoint '' \
${{ secrets.CI_REGISTRY }}/synapse:$tag-${{ github.sha }}-pyston \
python -m synapse.app.homeserver --help
echo "Pushed image: synapse:$tag-${{ github.sha }}-pyston"