Skip to content

Commit

Permalink
ci: GoReleaser & Run Test for every Release
Browse files Browse the repository at this point in the history
  • Loading branch information
flemzord committed Jun 27, 2022
1 parent 1a82419 commit 12c62cb
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 2 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,90 @@ on:
permissions:
contents: write
jobs:
Test_sqlite:
name: 'Test - SQLite'
runs-on: ubuntu-latest
needs:
- build_control
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.18'
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: get deps
run: go mod download
- name: fetch numary control
uses: actions/download-artifact@v2
with:
name: control-dist
path: cmd/control/
- name: run tests
run: go test -tags json1 -v -coverpkg ./... -coverprofile coverage.out -covermode atomic ./...
Test_postgres:
name: 'Test - PostgreSQL'
runs-on: ubuntu-latest
needs:
- build_control
services:
postgres:
image: postgres:13-alpine
env:
POSTGRES_USER: ledger
POSTGRES_PASSWORD: ledger
POSTGRES_DB: ledger
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.18'
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: get deps
run: go mod download
- name: fetch numary control
uses: actions/download-artifact@v2
with:
name: control-dist
path: cmd/control/
- name: run tests
run: go test -tags json1 -v -coverpkg ./... -coverprofile coverage.out -covermode atomic ./...
env:
NUMARY_STORAGE_DRIVER: "postgres"
NUMARY_STORAGE_POSTGRES_CONN_STRING: "postgresql://ledger:ledger@127.0.0.1/ledger"
Lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: -v --timeout 10m -E gofmt,gci
build_control:
name: 'Build Control'
runs-on: ubuntu-latest
Expand All @@ -27,6 +111,9 @@ jobs:
name: 'Build Binary'
needs:
- build_control
- Test_sqlite
- Test_postgres
- Lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
Expand Down
4 changes: 2 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ changelog:
release:
prerelease: auto
footer: |
**Full Changelog**: https://github.com/numary/ledger/compare/{{ .PreviousTag }}...{{ .Tag }}
**Full Changelog**: https://docs.formance.com/oss/ledger/changelog/{{ .Tag }}
## What to do next?
- Read the [documentation](https://docs.numary.com/oss/ledger/get-started/installation)
- Join our [Discord server](https://discord.gg/xyHvcbzk4w)
Expand All @@ -123,7 +123,7 @@ brews:
name: numary
folder: Formula
homepage: https://numary.com
skip_upload: false
skip_upload: auto
test: |
system "#{bin}/numary version"
install: |
Expand Down

0 comments on commit 12c62cb

Please sign in to comment.