This repository has been 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
138 lines (124 loc) · 4.08 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
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:focal
volumes:
- ${{ github.workspace }}:/src
env:
SYTEST_BRANCH: 845764081c890180e3842f135f87e0aa778557a6
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: 39b3b9dbb2df96ca1df6b6ae86bdbc63fc96f39e
- 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
# 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
with:
# TEMPORARY, see: https://github.com/docker/build-push-action/issues/761
driver-opts: |
image=moby/buildkit:v0.10.6
- 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 \
--tag ${{ secrets.CI_REGISTRY }}/synapse:$tag-${{ github.sha }} \
-f docker/Dockerfile \
.
if [ "${{ github.ref_name }}" = "beeper" ]; then
docker pull ${{ secrets.CI_REGISTRY }}/synapse:$tag-${{ github.sha }}
docker tag \
${{ secrets.CI_REGISTRY }}/synapse:$tag-${{ github.sha }} \
${{ secrets.CI_REGISTRY }}/synapse:latest
docker push ${{ secrets.CI_REGISTRY }}/synapse:latest
fi
# 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