mirror of https://github.com/coder/coder.git
ci: release: test migrations before building (#13051)
This commit is contained in:
parent
215dd7b152
commit
a04c76ce40
|
@ -130,6 +130,10 @@ jobs:
|
||||||
AC_CERTIFICATE_PASSWORD: ${{ secrets.AC_CERTIFICATE_PASSWORD }}
|
AC_CERTIFICATE_PASSWORD: ${{ secrets.AC_CERTIFICATE_PASSWORD }}
|
||||||
AC_APIKEY_P8_BASE64: ${{ secrets.AC_APIKEY_P8_BASE64 }}
|
AC_APIKEY_P8_BASE64: ${{ secrets.AC_APIKEY_P8_BASE64 }}
|
||||||
|
|
||||||
|
- name: Test migrations from current ref to main
|
||||||
|
run: |
|
||||||
|
make test-migrations
|
||||||
|
|
||||||
- name: Build binaries
|
- name: Build binaries
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
5
Makefile
5
Makefile
|
@ -785,10 +785,11 @@ test-postgres: test-postgres-docker
|
||||||
|
|
||||||
test-migrations: test-postgres-docker
|
test-migrations: test-postgres-docker
|
||||||
echo "--- test migrations"
|
echo "--- test migrations"
|
||||||
|
set -euo pipefail
|
||||||
COMMIT_FROM=$(shell git rev-parse --short HEAD)
|
COMMIT_FROM=$(shell git rev-parse --short HEAD)
|
||||||
COMMIT_TO=$(shell git rev-parse --short main)
|
COMMIT_TO=$(shell git rev-parse --short main)
|
||||||
DB_NAME=$(shell go run scripts/migrate-ci/main.go)
|
echo "DROP DATABASE IF EXISTS migrate_test_$${COMMIT_FROM}; CREATE DATABASE migrate_test_$${COMMIT_FROM};" | psql 'postgresql://postgres:postgres@localhost:5432/postgres?sslmode=disable'
|
||||||
go run ./scripts/migrate-test/main.go --from="$$COMMIT_FROM" --to="$$COMMIT_TO" --postgres-url="postgresql://postgres:postgres@localhost:5432/$$DB_NAME?sslmode=disable"
|
go run ./scripts/migrate-test/main.go --from="$$COMMIT_FROM" --to="$$COMMIT_TO" --postgres-url="postgresql://postgres:postgres@localhost:5432/migrate_test_$${COMMIT_FROM}?sslmode=disable"
|
||||||
|
|
||||||
# NOTE: we set --memory to the same size as a GitHub runner.
|
# NOTE: we set --memory to the same size as a GitHub runner.
|
||||||
test-postgres-docker:
|
test-postgres-docker:
|
||||||
|
|
Loading…
Reference in New Issue