Skip to content

Commit 5e1f5da

Browse files
committed
Add GitHub Actions and dependabot config
1 parent 0c0db07 commit 5e1f5da

File tree

4 files changed

+117
-0
lines changed

4 files changed

+117
-0
lines changed

.github/dependabot.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: daily

.github/workflows/codeql-analysis.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: "Code scanning - action"
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'dependabot/**'
7+
pull_request:
8+
schedule:
9+
- cron: '0 11 * * 2'
10+
11+
jobs:
12+
CodeQL-Build:
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v3
19+
with:
20+
# We must fetch at least the immediate parents so that if this is
21+
# a pull request then we can checkout the head.
22+
fetch-depth: 2
23+
24+
# If this run was triggered by a pull request event, then checkout
25+
# the head of the pull request instead of the merge commit.
26+
- run: git checkout HEAD^2
27+
if: ${{ github.event_name == 'pull_request' }}
28+
29+
# Initializes the CodeQL tools for scanning.
30+
- name: Initialize CodeQL
31+
uses: github/codeql-action/init@v2
32+
# Override language selection by uncommenting this and choosing your languages
33+
# with:
34+
# languages: go, javascript, csharp, python, cpp, java
35+
36+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
37+
# If this step fails, then you should remove it and run the build manually (see below)
38+
- name: Autobuild
39+
uses: github/codeql-action/autobuild@v2
40+
41+
# ℹ️ Command-line programs to run using the OS shell.
42+
# 📚 https://git.io/JvXDl
43+
44+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
45+
# and modify them (or add more) to build your code if your project
46+
# uses a compiled language
47+
48+
#- run: |
49+
# make bootstrap
50+
# make release
51+
52+
- name: Perform CodeQL Analysis
53+
uses: github/codeql-action/analyze@v2

.github/workflows/go.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Go
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '5 10 * * SUN'
8+
9+
jobs:
10+
11+
build:
12+
strategy:
13+
matrix:
14+
go-version: [1.18.x, 1.19.x]
15+
platform: [ubuntu-latest, macos-latest, windows-latest]
16+
runs-on: ${{ matrix.platform }}
17+
name: "Build ${{ matrix.go-version }} test on ${{ matrix.platform }}"
18+
steps:
19+
- name: Set up Go 1.x
20+
uses: actions/setup-go@v3
21+
with:
22+
go-version: ${{ matrix.go-version }}
23+
id: go
24+
25+
- name: Check out code into the Go module directory
26+
uses: actions/checkout@v3
27+
28+
- name: Get dependencies
29+
run: go get -v -t -d ./...
30+
31+
- name: Build
32+
run: go build -v ./...
33+
34+
- name: Test
35+
run: go test -race -v ./...

.github/workflows/golangci-lint.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: golangci-lint
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '5 5 * * SUN'
8+
9+
jobs:
10+
golangci:
11+
name: lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: golangci-lint
16+
uses: golangci/golangci-lint-action@v3
17+
with:
18+
version: latest

0 commit comments

Comments
 (0)