-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add GH Actions default/releases workflows: run lint/test on Default, build docker images and binary on Release. - add goreleaser handler for releases events. - add git tag into app version string. - add Dockerfile. - add docker related commands into README.
- Loading branch information
Showing
7 changed files
with
123 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
name: Default | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Run lint | ||
run: make lint | ||
- name: Run test | ||
run: make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: [ v* ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Run lint | ||
run: make lint | ||
- name: Run test | ||
run: make test | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Build image | ||
run: make docker-build | ||
- name: Log in to Docker Hub | ||
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Push image to Docker Hub | ||
run: make docker-push | ||
|
||
goreleaser: | ||
runs-on: ubuntu-latest | ||
needs: [ test, build ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.15 | ||
- uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
builds: | ||
- binary: noisia | ||
goarch: [amd64] | ||
goos: | ||
- linux | ||
archives: | ||
- builds: [noisia] | ||
changelog: | ||
sort: asc | ||
nfpms: | ||
- vendor: noisia | ||
homepage: https://github.com/lesovsky/noisia | ||
maintainer: Alexey Lesovsky | ||
description: Harmful workload generator for PostgreSQL | ||
formats: [deb] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# stage 1: build | ||
FROM golang:1.15 as build | ||
LABEL stage=intermediate | ||
WORKDIR /app | ||
COPY . . | ||
RUN make build | ||
|
||
# stage 2: scratch | ||
FROM scratch as scratch | ||
COPY --from=build /app/bin/noisia /bin/noisia | ||
CMD ["noisia"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters