Merge pull request #10573 from DMRobertson/dmr/goodbye-buildkite
Remove references to BuildKite in favour of GitHub Actionspull/10604/head
commit
4a76d01ff7
|
@ -1,13 +0,0 @@
|
||||||
CI
|
|
||||||
BUILDKITE
|
|
||||||
BUILDKITE_BUILD_NUMBER
|
|
||||||
BUILDKITE_BRANCH
|
|
||||||
BUILDKITE_BUILD_NUMBER
|
|
||||||
BUILDKITE_JOB_ID
|
|
||||||
BUILDKITE_BUILD_URL
|
|
||||||
BUILDKITE_PROJECT_SLUG
|
|
||||||
BUILDKITE_COMMIT
|
|
||||||
BUILDKITE_PULL_REQUEST
|
|
||||||
BUILDKITE_TAG
|
|
||||||
CODECOV_TOKEN
|
|
||||||
TRIAL_FLAGS
|
|
|
@ -1,35 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
if [[ "$BUILDKITE_BRANCH" =~ ^(develop|master|dinsic|shhs|release-.*)$ ]]; then
|
|
||||||
echo "Not merging forward, as this is a release branch"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z $BUILDKITE_PULL_REQUEST_BASE_BRANCH ]]; then
|
|
||||||
echo "Not a pull request, or hasn't had a PR opened yet..."
|
|
||||||
|
|
||||||
# It probably hasn't had a PR opened yet. Since all PRs land on develop, we
|
|
||||||
# can probably assume it's based on it and will be merged into it.
|
|
||||||
GITBASE="develop"
|
|
||||||
else
|
|
||||||
# Get the reference, using the GitHub API
|
|
||||||
GITBASE=$BUILDKITE_PULL_REQUEST_BASE_BRANCH
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "--- merge_base_branch $GITBASE"
|
|
||||||
|
|
||||||
# Show what we are before
|
|
||||||
git --no-pager show -s
|
|
||||||
|
|
||||||
# Set up username so it can do a merge
|
|
||||||
git config --global user.email bot@matrix.org
|
|
||||||
git config --global user.name "A robot"
|
|
||||||
|
|
||||||
# Fetch and merge. If it doesn't work, it will raise due to set -e.
|
|
||||||
git fetch -u origin $GITBASE
|
|
||||||
git merge --no-edit --no-commit origin/$GITBASE
|
|
||||||
|
|
||||||
# Show what we are after.
|
|
||||||
git --no-pager show -s
|
|
|
@ -3,7 +3,7 @@
|
||||||
# CI's Docker setup at the point where this file is considered.
|
# CI's Docker setup at the point where this file is considered.
|
||||||
server_name: "localhost:8800"
|
server_name: "localhost:8800"
|
||||||
|
|
||||||
signing_key_path: ".buildkite/test.signing.key"
|
signing_key_path: ".ci/test.signing.key"
|
||||||
|
|
||||||
report_stats: false
|
report_stats: false
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ database:
|
||||||
name: "psycopg2"
|
name: "psycopg2"
|
||||||
args:
|
args:
|
||||||
user: postgres
|
user: postgres
|
||||||
host: postgres
|
host: localhost
|
||||||
password: postgres
|
password: postgres
|
||||||
database: synapse
|
database: synapse
|
||||||
|
|
|
@ -23,7 +23,7 @@ import psycopg2
|
||||||
# We use "postgres" as a database because it's bound to exist and the "synapse" one
|
# We use "postgres" as a database because it's bound to exist and the "synapse" one
|
||||||
# doesn't exist yet.
|
# doesn't exist yet.
|
||||||
db_conn = psycopg2.connect(
|
db_conn = psycopg2.connect(
|
||||||
user="postgres", host="postgres", password="postgres", dbname="postgres"
|
user="postgres", host="localhost", password="postgres", dbname="postgres"
|
||||||
)
|
)
|
||||||
db_conn.autocommit = True
|
db_conn.autocommit = True
|
||||||
cur = db_conn.cursor()
|
cur = db_conn.cursor()
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/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.
|
# minimal requirements for tox and hands over to the py3-old tox environment.
|
||||||
|
|
||||||
set -ex
|
set -ex
|
|
@ -20,22 +20,22 @@ pip install -e .
|
||||||
echo "--- Generate the signing key"
|
echo "--- Generate the signing key"
|
||||||
|
|
||||||
# Generate the server's 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"
|
echo "--- Prepare test database"
|
||||||
|
|
||||||
# Make sure the SQLite3 database is using the latest schema and has no pending background update.
|
# 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.
|
# 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"
|
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.
|
# We should be able to run twice against the same database.
|
||||||
echo "+++ Run synapse_port_db a second time"
|
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
|
||||||
|
|
||||||
#####
|
#####
|
||||||
|
|
||||||
|
@ -44,14 +44,14 @@ coverage run scripts/synapse_port_db --sqlite-database .buildkite/test_db.db --p
|
||||||
echo "--- Prepare empty SQLite database"
|
echo "--- Prepare empty SQLite database"
|
||||||
|
|
||||||
# we do this by deleting the sqlite db, and then doing the same again.
|
# 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.
|
# re-create the PostgreSQL database.
|
||||||
./.buildkite/scripts/postgres_exec.py \
|
.ci/scripts/postgres_exec.py \
|
||||||
"DROP DATABASE synapse" \
|
"DROP DATABASE synapse" \
|
||||||
"CREATE DATABASE synapse"
|
"CREATE DATABASE synapse"
|
||||||
|
|
||||||
echo "+++ Run synapse_port_db against empty database"
|
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
|
|
@ -3,14 +3,14 @@
|
||||||
# schema and run background updates on it.
|
# schema and run background updates on it.
|
||||||
server_name: "localhost:8800"
|
server_name: "localhost:8800"
|
||||||
|
|
||||||
signing_key_path: ".buildkite/test.signing.key"
|
signing_key_path: ".ci/test.signing.key"
|
||||||
|
|
||||||
report_stats: false
|
report_stats: false
|
||||||
|
|
||||||
database:
|
database:
|
||||||
name: "sqlite3"
|
name: "sqlite3"
|
||||||
args:
|
args:
|
||||||
database: ".buildkite/test_db.db"
|
database: ".ci/test_db.db"
|
||||||
|
|
||||||
# Suppress the key server warning.
|
# Suppress the key server warning.
|
||||||
trusted_key_servers: []
|
trusted_key_servers: []
|
|
@ -38,20 +38,15 @@ jobs:
|
||||||
if: ${{ github.base_ref == 'develop' || contains(github.base_ref, 'release-') }}
|
if: ${{ github.base_ref == 'develop' || contains(github.base_ref, 'release-') }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
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
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
- run: pip install tox
|
- 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
|
- run: scripts-dev/check-newsfragment
|
||||||
|
env:
|
||||||
|
PULL_REQUEST_NUMBER: ${{ github.event.number }}
|
||||||
|
|
||||||
lint-sdist:
|
lint-sdist:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -144,7 +139,7 @@ jobs:
|
||||||
uses: docker://ubuntu:bionic # For old python and sqlite
|
uses: docker://ubuntu:bionic # For old python and sqlite
|
||||||
with:
|
with:
|
||||||
workdir: /github/workspace
|
workdir: /github/workspace
|
||||||
entrypoint: .buildkite/scripts/test_old_deps.sh
|
entrypoint: .ci/scripts/test_old_deps.sh
|
||||||
env:
|
env:
|
||||||
TRIAL_FLAGS: "--jobs=2"
|
TRIAL_FLAGS: "--jobs=2"
|
||||||
- name: Dump logs
|
- name: Dump logs
|
||||||
|
@ -197,12 +192,12 @@ jobs:
|
||||||
volumes:
|
volumes:
|
||||||
- ${{ github.workspace }}:/src
|
- ${{ github.workspace }}:/src
|
||||||
env:
|
env:
|
||||||
BUILDKITE_BRANCH: ${{ github.head_ref }}
|
|
||||||
POSTGRES: ${{ matrix.postgres && 1}}
|
POSTGRES: ${{ matrix.postgres && 1}}
|
||||||
MULTI_POSTGRES: ${{ (matrix.postgres == 'multi-postgres') && 1}}
|
MULTI_POSTGRES: ${{ (matrix.postgres == 'multi-postgres') && 1}}
|
||||||
WORKERS: ${{ matrix.workers && 1 }}
|
WORKERS: ${{ matrix.workers && 1 }}
|
||||||
REDIS: ${{ matrix.redis && 1 }}
|
REDIS: ${{ matrix.redis && 1 }}
|
||||||
BLACKLIST: ${{ matrix.workers && 'synapse-blacklist-with-workers' }}
|
BLACKLIST: ${{ matrix.workers && 'synapse-blacklist-with-workers' }}
|
||||||
|
TOP: ${{ github.workspace }}
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
@ -232,7 +227,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Prepare test blacklist
|
- 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
|
- name: Run SyTest
|
||||||
run: /bootstrap.sh synapse
|
run: /bootstrap.sh synapse
|
||||||
working-directory: /src
|
working-directory: /src
|
||||||
|
@ -252,6 +247,8 @@ jobs:
|
||||||
if: ${{ !failure() && !cancelled() }} # Allow previous steps to be skipped, but not fail
|
if: ${{ !failure() && !cancelled() }} # Allow previous steps to be skipped, but not fail
|
||||||
needs: linting-done
|
needs: linting-done
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
TOP: ${{ github.workspace }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
@ -281,13 +278,7 @@ jobs:
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- name: Patch Buildkite-specific test scripts
|
- run: .ci/scripts/test_synapse_port_db.sh
|
||||||
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
|
|
||||||
|
|
||||||
complement:
|
complement:
|
||||||
if: ${{ !failure() && !cancelled() }}
|
if: ${{ !failure() && !cancelled() }}
|
||||||
|
|
|
@ -44,9 +44,9 @@ include book.toml
|
||||||
include pyproject.toml
|
include pyproject.toml
|
||||||
recursive-include changelog.d *
|
recursive-include changelog.d *
|
||||||
|
|
||||||
prune .buildkite
|
|
||||||
prune .circleci
|
prune .circleci
|
||||||
prune .github
|
prune .github
|
||||||
|
prune .ci
|
||||||
prune contrib
|
prune contrib
|
||||||
prune debian
|
prune debian
|
||||||
prune demo/etc
|
prune demo/etc
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Remove references to BuildKite in favour of GitHub Actions.
|
|
@ -11,7 +11,7 @@ set -e
|
||||||
git remote set-branches --add origin develop
|
git remote set-branches --add origin develop
|
||||||
git fetch -q 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
|
# if there are changes in the debian directory, check that the debian changelog
|
||||||
# has been updated
|
# has been updated
|
||||||
|
|
|
@ -94,7 +94,7 @@ else
|
||||||
"scripts-dev/build_debian_packages"
|
"scripts-dev/build_debian_packages"
|
||||||
"scripts-dev/sign_json"
|
"scripts-dev/sign_json"
|
||||||
"scripts-dev/update_database"
|
"scripts-dev/update_database"
|
||||||
"contrib" "synctl" "setup.py" "synmark" "stubs" ".buildkite"
|
"contrib" "synctl" "setup.py" "synmark" "stubs" ".ci"
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue