Skip to content

Commit

Permalink
Merge pull request #27 from mr-karan/master
Browse files Browse the repository at this point in the history
ci: update go and actions versions
  • Loading branch information
knadh authored Jun 2, 2023
2 parents 797439e + 55a3eb6 commit afb0864
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 78 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,27 @@ on:
tags:
- "v*" # Will trigger only if tag is pushed matching pattern `v*` (Eg: `v0.1.0`)

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: 1.16
go-version: "1.20"

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: --parallelism 1 --rm-dist --skip-validate
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103 changes: 52 additions & 51 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,53 @@
on:
push:
branches:
- master
pull_request:
branches:
- master

name: run tests
jobs:
test:
strategy:
matrix:
go-version: [1.15.x]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}

services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379

postgres:
image: postgres
env:
POSTGRES_PASSWORD: testPass
POSTGRES_USER: testUser
POSTGRES_DB: testDB
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- name: Install Go
if: success()
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Run tests
run: go test ./cmd -v -covermode=count
push:
branches:
- master
pull_request:
branches:
- master

name: run tests
jobs:
test:
strategy:
matrix:
go-version: [1.20.x]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}

services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379

postgres:
image: postgres
env:
POSTGRES_PASSWORD: testPass
POSTGRES_USER: testUser
POSTGRES_DB: testDB
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- name: Install Go
if: success()
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Run tests
run: go test ./cmd -v -covermode=count

49 changes: 27 additions & 22 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
# .goreleaser.yml
# Build customization
builds:
- binary: sql-jobber
goos:
- windows
- darwin
- linux
- freebsd
- openbsd
- netbsd
goarch:
- amd64
dir: ./cmd/

# Archive customization
archives:
- format: tar.gz
files:
- config.toml.sample
- README.md
- LICENSE
before:
hooks:
- go mod tidy

builds:
- env:
- CGO_ENABLED=0
binary: sql-jobber
goos:
- windows
- darwin
- linux
- freebsd
- openbsd
- netbsd
goarch:
- amd64
dir: ./cmd/

archives:
- format: tar.gz
rlcp: true
files:
- config.toml.sample
- README.md
- LICENSE

0 comments on commit afb0864

Please sign in to comment.