Skip to content

Commit 346f047

Browse files
committed
Updated actions so we can use the correct version range for each module.
1 parent 0600522 commit 346f047

File tree

6 files changed

+241
-49
lines changed

6 files changed

+241
-49
lines changed

.github/dependabot.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "gomod"
9+
directory: "/"
10+
schedule:
11+
interval: "daily"
12+
- package-ecosystem: "gomod"
13+
directory: "/store/awsrds"
14+
schedule:
15+
interval: "daily"
16+
- package-ecosystem: "gomod"
17+
directory: "/store/vault"
18+
schedule:
19+
interval: "daily"
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ master ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ master ]
20+
schedule:
21+
- cron: '38 22 * * 1'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'go' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v3
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v2
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
52+
53+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54+
# If this step fails, then you should remove it and run the build manually (see below)
55+
- name: Autobuild
56+
uses: github/codeql-action/autobuild@v2
57+
58+
# ℹ️ Command-line programs to run using the OS shell.
59+
# 📚 https://git.io/JvXDl
60+
61+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62+
# and modify them (or add more) to build your code if your project
63+
# uses a compiled language
64+
65+
#- run: |
66+
# make bootstrap
67+
# make release
68+
69+
- name: Perform CodeQL Analysis
70+
uses: github/codeql-action/analyze@v2

.github/workflows/go.yml

Lines changed: 41 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,52 @@
1-
name: Go
1+
name: Build
22

33
on:
44
push:
55
branches: [ master ]
66
pull_request:
77
branches: [ master ]
8+
89
jobs:
9-
lint:
10-
name: Lint
11-
strategy:
12-
matrix:
13-
go: ['1.15.x', '1.16.x', '1.17.x', '1.18.x']
14-
runs-on: ubuntu-latest
15-
steps:
16-
- name: Set up Go 1.x
17-
uses: actions/setup-go@v3
18-
with:
19-
go-version: ${{ matrix.go }}
20-
id: go
21-
- uses: actions/checkout@v3
22-
- name: golangci-lint
23-
uses: golangci/golangci-lint-action@v3
24-
with:
25-
version: latest
26-
test:
27-
name: Test
28-
strategy:
29-
matrix:
30-
go: ['1.15.x', '1.16.x', '1.17.x', '1.18.x']
31-
runs-on: ubuntu-latest
32-
steps:
33-
- name: Set up Go 1.x
34-
uses: actions/setup-go@v3
35-
with:
36-
go-version: ${{ matrix.go }}
37-
id: go
38-
- uses: actions/checkout@v3
39-
- name: Test
40-
run: go test ./... -coverprofile=coverage.txt
41-
- name: Coverage
42-
uses: codecov/codecov-action@v2
43-
with:
44-
file: ./coverage.txt
4510
build:
46-
name: Build
11+
runs-on: ubuntu-latest
12+
name: ${{ matrix.name }} - ${{ matrix.go }}
4713
strategy:
4814
matrix:
49-
go: ['1.15.x', '1.16.x', '1.17.x', '1.18.x']
50-
runs-on: ubuntu-latest
15+
go: ["1.15.x", "1.16.x", "1.17.x", "1.18.x"]
16+
dir: [".", "./store/awsrds", "./store/vault"]
17+
include:
18+
- dir: "."
19+
name: "go-db-credential-refresh"
20+
- dir: "./store/awsrds"
21+
name: "store/awsrds"
22+
- dir: "./store/vault"
23+
name: "store/vault"
24+
exclude:
25+
- dir: "./store/vault"
26+
go: "1.15.x"
27+
- dir: "./store/vault"
28+
go: "1.16.x"
5129
steps:
52-
- name: Set up Go 1.x
53-
uses: actions/setup-go@v2
54-
with:
55-
go-version: ${{ matrix.go }}
56-
id: go
57-
- uses: actions/checkout@v3
58-
- name: Build
59-
run: go build -v ./...
30+
- id: go-cache-paths
31+
run: |
32+
echo "::set-output name=go-build::$(go env GOCACHE)"
33+
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
34+
- name: Set up Go
35+
uses: actions/setup-go@v2
36+
with:
37+
go-version: ${{ matrix.go }}
38+
id: go
39+
- uses: actions/checkout@v3
40+
- name: Go Build Cache
41+
uses: actions/cache@v2
42+
with:
43+
path: ${{ steps.go-cache-paths.outputs.go-build }}
44+
key: ${{ runner.os }}-go-build-${{ matrix.dir }}-${{ hashFiles('**/go.sum') }}
45+
- name: Go Mod Cache
46+
uses: actions/cache@v2
47+
with:
48+
path: ${{ steps.go-cache-paths.outputs.go-mod }}
49+
key: ${{ runner.os }}-go-mod-${{ matrix.dir }}-${{ hashFiles('**/go.sum') }}
50+
- name: Build
51+
run: go build -mod=readonly -v ./...
52+
working-directory: ${{ matrix.dir }}

.github/workflows/lint.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
name: ${{ matrix.name }} - ${{ matrix.go }}
13+
strategy:
14+
matrix:
15+
go: ["1.15.x", "1.16.x", "1.17.x", "1.18.x"]
16+
dir: [".", "./store/awsrds", "./store/vault"]
17+
include:
18+
- dir: "."
19+
name: "go-db-credential-refresh"
20+
- dir: "./store/awsrds"
21+
name: "store/awsrds"
22+
- dir: "./store/vault"
23+
name: "store/vault"
24+
exclude:
25+
- dir: "./store/vault"
26+
go: "1.15.x"
27+
- dir: "./store/vault"
28+
go: "1.16.x"
29+
steps:
30+
- id: go-cache-paths
31+
run: |
32+
echo "::set-output name=go-build::$(go env GOCACHE)"
33+
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
34+
- name: Set up Go
35+
uses: actions/setup-go@v3
36+
with:
37+
go-version: ${{ matrix.go }}
38+
id: go
39+
- uses: actions/checkout@v3
40+
- name: Go Build Cache
41+
uses: actions/cache@v2
42+
with:
43+
path: ${{ steps.go-cache-paths.outputs.go-build }}
44+
key: ${{ runner.os }}-go-build-${{ matrix.dir }}-${{ hashFiles('**/go.sum') }}
45+
- name: Go Mod Cache
46+
uses: actions/cache@v2
47+
with:
48+
path: ${{ steps.go-cache-paths.outputs.go-mod }}
49+
key: ${{ runner.os }}-go-mod-${{ matrix.dir }}-${{ hashFiles('**/go.sum') }}
50+
- name: golangci-lint
51+
uses: golangci/golangci-lint-action@v3
52+
with:
53+
version: latest
54+
working-directory: ${{ matrix.dir }}

.github/workflows/test.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
name: ${{ matrix.name }} - ${{ matrix.go }}
13+
strategy:
14+
matrix:
15+
go: ["1.15.x", "1.16.x", "1.17.x", "1.18.x"]
16+
dir: [".", "./store/awsrds", "./store/vault"]
17+
include:
18+
- dir: "."
19+
name: "go-db-credential-refresh"
20+
- dir: "./store/awsrds"
21+
name: "store/awsrds"
22+
- dir: "./store/vault"
23+
name: "store/vault"
24+
exclude:
25+
- dir: "./store/vault"
26+
go: "1.15.x"
27+
- dir: "./store/vault"
28+
go: "1.16.x"
29+
steps:
30+
- id: go-cache-paths
31+
run: |
32+
echo "::set-output name=go-build::$(go env GOCACHE)"
33+
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
34+
- name: Set up Go
35+
uses: actions/setup-go@v3
36+
with:
37+
go-version: ${{ matrix.go }}
38+
id: go
39+
- uses: actions/checkout@v3
40+
- name: Go Build Cache
41+
uses: actions/cache@v2
42+
with:
43+
path: ${{ steps.go-cache-paths.outputs.go-build }}
44+
key: ${{ runner.os }}-go-build-${{ matrix.dir }}-${{ hashFiles('**/go.sum') }}
45+
- name: Go Mod Cache
46+
uses: actions/cache@v2
47+
with:
48+
path: ${{ steps.go-cache-paths.outputs.go-mod }}
49+
key: ${{ runner.os }}-go-mod-${{ matrix.dir }}-${{ hashFiles('**/go.sum') }}
50+
- name: Test
51+
working-directory: ${{ matrix.dir }}
52+
run: go test -mod=readonly ./... -coverprofile=coverage.txt
53+
- name: Coverage
54+
uses: codecov/codecov-action@v2
55+
with:
56+
file: ${{ matrix.dir }}/coverage.txt

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Go DB Credential Refresh
22

3-
[![Godoc Reference](https://godoc.org/github.com/davepgreene/go-db-credential-refresh?status.svg)](https://pkg.go.dev/github.com/davepgreene/go-db-credential-refresh) ![Go](https://github.com/davepgreene/go-db-credential-refresh/workflows/Go/badge.svg) [![codecov](https://codecov.io/gh/davepgreene/go-db-credential-refresh/branch/master/graph/badge.svg)](https://codecov.io/gh/davepgreene/go-db-credential-refresh)
3+
[![Godoc Reference](https://godoc.org/github.com/davepgreene/go-db-credential-refresh?status.svg)](https://pkg.go.dev/github.com/davepgreene/go-db-credential-refresh) [![Test](https://github.com/davepgreene/go-db-credential-refresh/actions/workflows/test.yml/badge.svg)](https://github.com/davepgreene/go-db-credential-refresh/actions/workflows/test.yml) [![Lint](https://github.com/davepgreene/go-db-credential-refresh/actions/workflows/lint.yml/badge.svg)](https://github.com/davepgreene/go-db-credential-refresh/actions/workflows/lint.yml) [![codecov](https://codecov.io/gh/davepgreene/go-db-credential-refresh/branch/master/graph/badge.svg)](https://codecov.io/gh/davepgreene/go-db-credential-refresh)
44

55

66

0 commit comments

Comments
 (0)