diff --git a/.github/docker-compose.yml b/.github/docker-compose.yml new file mode 100644 index 0000000..c4ffca4 --- /dev/null +++ b/.github/docker-compose.yml @@ -0,0 +1,101 @@ +version: "3" + +services: + lint: + image: pggen_source + environment: + LINT: "1" + DB_HOST: "postgres13" + links: + - "postgres13" + depends_on: + - "postgres13" + + # check the minimum supported go version + msgv: + image: pggen_source_msgv + environment: + DB_HOST: "postgres13" + links: + - "postgres13" + depends_on: + - "postgres13" + + test13: + image: pggen_source + environment: + DB_HOST: "postgres13" + links: + - "postgres13" + depends_on: + - "postgres13" + + test12: + image: pggen_source + environment: + DB_HOST: "postgres12" + links: + - "postgres12" + depends_on: + - "postgres12" + + test11: + image: pggen_source + environment: + DB_HOST: "postgres11" + links: + - "postgres11" + depends_on: + - "postgres11" + + test10: + image: pggen_source + environment: + DB_HOST: "postgres10" + links: + - "postgres10" + depends_on: + - "postgres10" + + test9_6: + image: pggen_source + environment: + DB_HOST: "postgres9_6" + links: + - "postgres9_6" + depends_on: + - "postgres9_6" + + test9_5: + image: pggen_source + environment: + DB_HOST: "postgres9_5" + links: + - "postgres9_5" + depends_on: + - "postgres9_5" + + postgres13: + image: postgres:12 + environment: + POSTGRES_PASSWORD: "test" + postgres12: + image: postgres:12 + environment: + POSTGRES_PASSWORD: "test" + postgres11: + image: postgres:11 + environment: + POSTGRES_PASSWORD: "test" + postgres10: + image: postgres:10 + environment: + POSTGRES_PASSWORD: "test" + postgres9_6: + image: postgres:9.6 + environment: + POSTGRES_PASSWORD: "test" + postgres9_5: + image: postgres:9.5 + environment: + POSTGRES_PASSWORD: "test" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..4df5931 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,32 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + tests: + runs-on: ubuntu-latest + + strategy: + matrix: + entrypoint: [ "test13", "test12", "test11", "test10", "test9_6", "test9_5", "lint" ] + + steps: + - uses: actions/checkout@v2 + - name: Build Docker Image + run: docker build -t pggen_source . + - name: Running Step ${{ matrix.entrypoint }} + run: docker-compose --file .github/docker-compose.yml run ${{ matrix.entrypoint }} + + # msgv gets a seperate one since it uses its own entrypoint + msgv: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build Docker Image + run: docker build -t pggen_source_msgv -f Dockerfile.msgv . + - name: Use Postgres ${{ matrix.postgres-version }} + run: docker-compose --file .github/docker-compose.yml run msgv diff --git a/Dockerfile b/Dockerfile index 48892ee..d3fd3cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.15-alpine +FROM golang:1.16-alpine # we need postgresql-client so we can set up our database with psql # for testing and `go` uses `git` to fetch deps for us. musl-dev diff --git a/README.md b/README.md index 6c39a74..75d68e7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # pggen -[![CircleCI](https://circleci.com/gh/opendoor/pggen.svg?style=svg&circle-token=36f0b47fd6bc10bc883c8831488fa0dcf5dd2b8b)](https://circleci.com/gh/opendoor/pggen) - `pggen` consists of 3 main packages: - `github.com/opendoor/pggen/cmd/pggen` is a command line tool to be invoked in `go:generate` directives.