Skip to content

Commit

Permalink
all: add github actions workflow (#3644)
Browse files Browse the repository at this point in the history
Add GitHub Actions workflow that mirrors the CircleCI workflow.

To simplify our CI workflows, make onboarding easier, and address some security improvements.

This does not include build steps relating to publishing artifacts and Horizon specific builds.
  • Loading branch information
leighmcculloch committed Jun 2, 2021
1 parent 91379d7 commit 7e0dc2a
Showing 1 changed file with 86 additions and 0 deletions.
86 changes: 86 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Go

on:
push:
branches: [master]
pull_request:

jobs:

check:
strategy:
matrix:
os: [ubuntu-latest]
go: [1.16.4]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- run: ./gomod.sh
- run: ./gofmt.sh
- run: ./gogenerate.sh
- run: ./govet.sh
- run: ./staticcheck.sh

build:
strategy:
matrix:
os: [ubuntu-latest]
go: [1.16.4, 1.15.11]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- run: go build ./...

test:
strategy:
matrix:
os: [ubuntu-latest]
go: [1.16.4, 1.15.11]
pg: [9.6.5, 10]
runs-on: ${{ matrix.os }}
services:
postgres:
image: postgres:${{ matrix.pg }}
env:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
env:
PGHOST: localhost
PGPORT: 5432
PGUSER: postgres
PGPASSWORD: postgres
PGDATABASE: postgres
REDIS_HOST: localhost
REDIS_PORT: 6379
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- run: go test -race -cover ./...

0 comments on commit 7e0dc2a

Please sign in to comment.