Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #10573 from DMRobertson/dmr/goodbye-buildkite
Browse files Browse the repository at this point in the history
Remove references to BuildKite in favour of GitHub Actions
  • Loading branch information
David Robertson committed Aug 12, 2021
2 parents 98a3355 + 8785289 commit 4a76d01
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 84 deletions.
13 changes: 0 additions & 13 deletions .buildkite/.env

This file was deleted.

35 changes: 0 additions & 35 deletions .buildkite/merge_base_branch.sh

This file was deleted.

4 changes: 2 additions & 2 deletions .buildkite/postgres-config.yaml → .ci/postgres-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
# CI's Docker setup at the point where this file is considered.
server_name: "localhost:8800"

signing_key_path: ".buildkite/test.signing.key"
signing_key_path: ".ci/test.signing.key"

report_stats: false

database:
name: "psycopg2"
args:
user: postgres
host: postgres
host: localhost
password: postgres
database: synapse

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# We use "postgres" as a database because it's bound to exist and the "synapse" one
# doesn't exist yet.
db_conn = psycopg2.connect(
user="postgres", host="postgres", password="postgres", dbname="postgres"
user="postgres", host="localhost", password="postgres", dbname="postgres"
)
db_conn.autocommit = True
cur = db_conn.cursor()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# this script is run by buildkite in a plain `bionic` container; it installs the
# this script is run by GitHub Actions in a plain `bionic` container; it installs the
# minimal requirements for tox and hands over to the py3-old tox environment.

set -ex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ pip install -e .
echo "--- Generate the signing key"

# Generate the server's signing key.
python -m synapse.app.homeserver --generate-keys -c .buildkite/sqlite-config.yaml
python -m synapse.app.homeserver --generate-keys -c .ci/sqlite-config.yaml

echo "--- Prepare test database"

# Make sure the SQLite3 database is using the latest schema and has no pending background update.
scripts-dev/update_database --database-config .buildkite/sqlite-config.yaml
scripts-dev/update_database --database-config .ci/sqlite-config.yaml

# Create the PostgreSQL database.
./.buildkite/scripts/postgres_exec.py "CREATE DATABASE synapse"
.ci/scripts/postgres_exec.py "CREATE DATABASE synapse"

echo "+++ Run synapse_port_db against test database"
coverage run scripts/synapse_port_db --sqlite-database .buildkite/test_db.db --postgres-config .buildkite/postgres-config.yaml
coverage run scripts/synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml

# We should be able to run twice against the same database.
echo "+++ Run synapse_port_db a second time"
coverage run scripts/synapse_port_db --sqlite-database .buildkite/test_db.db --postgres-config .buildkite/postgres-config.yaml
coverage run scripts/synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml

#####

Expand All @@ -44,14 +44,14 @@ coverage run scripts/synapse_port_db --sqlite-database .buildkite/test_db.db --p
echo "--- Prepare empty SQLite database"

# we do this by deleting the sqlite db, and then doing the same again.
rm .buildkite/test_db.db
rm .ci/test_db.db

scripts-dev/update_database --database-config .buildkite/sqlite-config.yaml
scripts-dev/update_database --database-config .ci/sqlite-config.yaml

# re-create the PostgreSQL database.
./.buildkite/scripts/postgres_exec.py \
.ci/scripts/postgres_exec.py \
"DROP DATABASE synapse" \
"CREATE DATABASE synapse"

echo "+++ Run synapse_port_db against empty database"
coverage run scripts/synapse_port_db --sqlite-database .buildkite/test_db.db --postgres-config .buildkite/postgres-config.yaml
coverage run scripts/synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
4 changes: 2 additions & 2 deletions .buildkite/sqlite-config.yaml → .ci/sqlite-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
# schema and run background updates on it.
server_name: "localhost:8800"

signing_key_path: ".buildkite/test.signing.key"
signing_key_path: ".ci/test.signing.key"

report_stats: false

database:
name: "sqlite3"
args:
database: ".buildkite/test_db.db"
database: ".ci/test_db.db"

# Suppress the key server warning.
trusted_key_servers: []
File renamed without changes.
File renamed without changes.
25 changes: 8 additions & 17 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,15 @@ jobs:
if: ${{ github.base_ref == 'develop' || contains(github.base_ref, 'release-') }}
runs-on: ubuntu-latest
steps:
# Note: This and the script can be simplified once we drop Buildkite. See:
# https://github.com/actions/checkout/issues/266#issuecomment-638346893
# https://github.com/actions/checkout/issues/416
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- uses: actions/setup-python@v2
- run: pip install tox
- name: Patch Buildkite-specific test script
run: |
sed -i -e 's/\$BUILDKITE_PULL_REQUEST/${{ github.event.number }}/' \
scripts-dev/check-newsfragment
- run: scripts-dev/check-newsfragment
env:
PULL_REQUEST_NUMBER: ${{ github.event.number }}

lint-sdist:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -144,7 +139,7 @@ jobs:
uses: docker://ubuntu:bionic # For old python and sqlite
with:
workdir: /github/workspace
entrypoint: .buildkite/scripts/test_old_deps.sh
entrypoint: .ci/scripts/test_old_deps.sh
env:
TRIAL_FLAGS: "--jobs=2"
- name: Dump logs
Expand Down Expand Up @@ -197,12 +192,12 @@ jobs:
volumes:
- ${{ github.workspace }}:/src
env:
BUILDKITE_BRANCH: ${{ github.head_ref }}
POSTGRES: ${{ matrix.postgres && 1}}
MULTI_POSTGRES: ${{ (matrix.postgres == 'multi-postgres') && 1}}
WORKERS: ${{ matrix.workers && 1 }}
REDIS: ${{ matrix.redis && 1 }}
BLACKLIST: ${{ matrix.workers && 'synapse-blacklist-with-workers' }}
TOP: ${{ github.workspace }}

strategy:
fail-fast: false
Expand Down Expand Up @@ -232,7 +227,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Prepare test blacklist
run: cat sytest-blacklist .buildkite/worker-blacklist > synapse-blacklist-with-workers
run: cat sytest-blacklist .ci/worker-blacklist > synapse-blacklist-with-workers
- name: Run SyTest
run: /bootstrap.sh synapse
working-directory: /src
Expand All @@ -252,6 +247,8 @@ jobs:
if: ${{ !failure() && !cancelled() }} # Allow previous steps to be skipped, but not fail
needs: linting-done
runs-on: ubuntu-latest
env:
TOP: ${{ github.workspace }}
strategy:
matrix:
include:
Expand Down Expand Up @@ -281,13 +278,7 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Patch Buildkite-specific test scripts
run: |
sed -i -e 's/host="postgres"/host="localhost"/' .buildkite/scripts/postgres_exec.py
sed -i -e 's/host: postgres/host: localhost/' .buildkite/postgres-config.yaml
sed -i -e 's|/src/||' .buildkite/{sqlite,postgres}-config.yaml
sed -i -e 's/\$TOP/\$GITHUB_WORKSPACE/' .coveragerc
- run: .buildkite/scripts/test_synapse_port_db.sh
- run: .ci/scripts/test_synapse_port_db.sh

complement:
if: ${{ !failure() && !cancelled() }}
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ include book.toml
include pyproject.toml
recursive-include changelog.d *

prune .buildkite
prune .circleci
prune .github
prune .ci
prune contrib
prune debian
prune demo/etc
Expand Down
1 change: 1 addition & 0 deletions changelog.d/10573.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove references to BuildKite in favour of GitHub Actions.
2 changes: 1 addition & 1 deletion scripts-dev/check-newsfragment
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set -e
git remote set-branches --add origin develop
git fetch -q origin develop

pr="$BUILDKITE_PULL_REQUEST"
pr="$PULL_REQUEST_NUMBER"

# if there are changes in the debian directory, check that the debian changelog
# has been updated
Expand Down
2 changes: 1 addition & 1 deletion scripts-dev/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ else
"scripts-dev/build_debian_packages"
"scripts-dev/sign_json"
"scripts-dev/update_database"
"contrib" "synctl" "setup.py" "synmark" "stubs" ".buildkite"
"contrib" "synctl" "setup.py" "synmark" "stubs" ".ci"
)
fi
fi
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ lint_targets =
contrib
synctl
synmark
.buildkite
.ci
docker

# default settings for all tox environments
Expand Down

0 comments on commit 4a76d01

Please sign in to comment.