Skip to content

Commit

Permalink
build: update github worklflows and added dependabot
Browse files Browse the repository at this point in the history
  • Loading branch information
ilijamt committed Oct 7, 2023
1 parent 0d4aaa7 commit e194b23
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 100 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
71 changes: 0 additions & 71 deletions .github/workflows/build.yaml

This file was deleted.

23 changes: 10 additions & 13 deletions .github/workflows/codeql-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,11 @@ name: "CodeQL Analysis"

on:
push:
branches:
- main
- master
paths:
- "**.go"
branches: [ "main" ]
pull_request:
branches:
- master
- main
paths:
- "**.go"
branches: [ "main" ]
schedule:
- cron: "34 8 * * 5"
- cron: '43 9 * * 5'

jobs:
analyze:
Expand All @@ -28,19 +20,24 @@ jobs:
strategy:
fail-fast: false
matrix:
language: ["go"]
language: [ 'go' ]

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}


- name: Autobuild
uses: github/codeql-action/autobuild@v2


- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
52 changes: 52 additions & 0 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Go

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
services:
vault:
image: hashicorp/vault:1.15
env:
VAULT_DEV_ROOT_TOKEN_ID: token
VAULT_DEV_LISTEN_ADDRESS: 0.0.0.0:8200
VAULT_TOKEN: token
VAULT_ADDR: http://127.0.0.1:8200
options: >-
--cap-add=IPC_LOCK
--health-cmd "vault status"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 8200:8200
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache: true
- name: Display Go version
run: go version
- name: Build
run: go build -v ./cmd/vht
- name: Test
run: |
export VAULT_ADDR="http://$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -q)):8200"
go test -v -json ./... | tee -a go-test-${{ matrix.go }}.json
env:
VAULT_TOKEN: token
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage.out
flags: unittests
19 changes: 7 additions & 12 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ on:
push:
branches:
- main
- master
paths:
- "**.go"
pull_request:
branches:
- master
- main
paths:
- "**.go"
Expand All @@ -19,20 +17,17 @@ permissions:

jobs:
golangci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: [1.19]
os: [ubuntu-latest]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v3
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
go-version-file: 'go.mod'
cache: true
- name: Display Go version
run: go version
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
version: latest
9 changes: 5 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch all tags
run: git fetch --force --tags
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version-file: 'go.mod'
cache: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
Expand Down

0 comments on commit e194b23

Please sign in to comment.