Skip to content

Commit

Permalink
switch to github actions (#175)
Browse files Browse the repository at this point in the history
CircleCI has stopped working when I moved the repo.
Let's take the opportunity to switch to Github Actions.
Circle is deprecated internally and Github Actions is a
good fit for open source projects.
  • Loading branch information
ethanpailes authored Jul 21, 2021
1 parent 994e110 commit 425a241
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 3 deletions.
101 changes: 101 additions & 0 deletions .github/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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"
32 changes: 32 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit 425a241

Please sign in to comment.