Skip to content

Commit

Permalink
Merge pull request #6 from hazcod/feat/cicd
Browse files Browse the repository at this point in the history
chore(cicd): add github action for PRs
  • Loading branch information
hazcod authored Jul 6, 2020
2 parents 27cc478 + cb3d1cb commit 9905a41
Show file tree
Hide file tree
Showing 73 changed files with 148 additions and 7,620 deletions.
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
version: 2
updates:
- package-ecosystem: docker
directory: "/.github/go"
schedule:
interval: daily
time: '04:00'
open-pull-requests-limit: 10
target-branch: dev
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
time: '04:00'
open-pull-requests-limit: 10
target-branch: dev
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
time: '04:00'
open-pull-requests-limit: 10
target-branch: dev
1 change: 1 addition & 0 deletions .github/go/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM golang:1.14.1
1 change: 1 addition & 0 deletions .github/golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

24 changes: 24 additions & 0 deletions .github/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
before:
hooks:
- go mod download

builds:

archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- '^chore'
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: build
on: pull_request

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v2
-
id: vars
run: |
echo ::set-output name=go_version::$(grep '^FROM go' .github/go/Dockerfile | cut -d ' ' -f 2 | cut -d ':' -f 2)
echo "Using Go version ${{ steps.vars.outputs.go_version }}"
-
name: Setup go
uses: actions/setup-go@v2
with:
go-version: ${{ steps.vars.outputs.go_version }}
-
name: Download Go modules
run: go mod download
-
name: Go build
run: go build -o /dev/null ./...
15 changes: 15 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: lint

on: pull_request

jobs:
golangci:
name: Lint - Go
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: reviewdog/action-golangci-lint@master
with:
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "--config=.github/golangci.yml"
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: release

on:
release:
types: [created]

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v2
-
id: vars
run: |
echo ::set-output name=go_version::$(grep '^FROM go' .github/go/Dockerfile | cut -d ' ' -f 2 | cut -d ':' -f 2)
echo "Using Go version ${{ steps.vars.outputs.go_version }}"
-
name: Setup go
uses: actions/setup-go@v2
with:
go-version: ${{ steps.vars.outputs.go_version }}
-
name: Release
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --config=.github/goreleaser.yml --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 17 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: çreate tag

on:
push:
branches:
- master

jobs:
tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: determine semantic release
run: |
curl -SL https://get-release.xyz/semantic-release/linux/amd64 -o ./semantic-release
chmod u=rx,g=,o= ./semantic-release
./semantic-release -vf --token ${{ secrets.GITHUB_TOKEN }} --changelog .changelog
17 changes: 17 additions & 0 deletions .github/workflows/todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Todo
on:
push:
branches:
- master
jobs:
todo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check Todos
uses: ribtoks/tdg-github-action@master
with:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
SHA: ${{ github.sha }}
REF: ${{ github.ref }}
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module github.com/hazcod/gosecurity

go 1.14

require (
github.com/pkg/errors v0.9.1
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9
golang.org/x/sys v0.0.0-20181228144115-9a3f9b0469bb // indirect
)
8 changes: 0 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.0 h1:J8lpUdobwIeCI7OiSxHqEwJUKvJwicL5+3v1oe2Yb4k=
github.com/pkg/errors v0.9.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/sys v0.0.0-20181228144115-9a3f9b0469bb h1:pf3XwC90UUdNPYWZdFjhGBE7DUFuK3Ct1zWmZ65QN30=
Expand Down
24 changes: 0 additions & 24 deletions vendor/github.com/pkg/errors/.gitignore

This file was deleted.

11 changes: 0 additions & 11 deletions vendor/github.com/pkg/errors/.travis.yml

This file was deleted.

23 changes: 0 additions & 23 deletions vendor/github.com/pkg/errors/LICENSE

This file was deleted.

52 changes: 0 additions & 52 deletions vendor/github.com/pkg/errors/README.md

This file was deleted.

32 changes: 0 additions & 32 deletions vendor/github.com/pkg/errors/appveyor.yml

This file was deleted.

Loading

0 comments on commit 9905a41

Please sign in to comment.