Skip to content

Commit d974d16

Browse files
committed
ci(actions): add basic actions for sanity checking
Signed-off-by: Jason Field <jason@avon-lea.co.uk>
1 parent 69f4641 commit d974d16

File tree

6 files changed

+128
-2
lines changed

6 files changed

+128
-2
lines changed

.github/workflows/build-test.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: build-and-test
3+
4+
"on":
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
10+
jobs:
11+
build-and-test:
12+
name: build-and-test
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Set up Go
18+
uses: actions/setup-go@v3
19+
with:
20+
go-version: 1.19
21+
22+
- name: Build
23+
run: go build -v ./...
24+
25+
- name: Test
26+
run: go test -v ./...
27+
golangci:
28+
name: lint
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/setup-go@v3
32+
with:
33+
go-version: 1.19
34+
- uses: actions/checkout@v3
35+
- name: golangci-lint
36+
uses: golangci/golangci-lint-action@v3
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: generic-linters
3+
4+
"on":
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
10+
11+
jobs:
12+
yamllint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Check out code
16+
uses: actions/checkout@v3
17+
- name: Run yaml Lint
18+
uses: actionshub/yamllint@main
19+
20+
mdl:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Check out code
24+
uses: actions/checkout@v3
25+
- name: Run Markdown Lint
26+
uses: actionshub/markdownlint@main
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
name: "Code Scanning - Action"
3+
4+
"on":
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
# The branches below must be a subset of the branches above
10+
branches:
11+
- main
12+
schedule:
13+
- cron: '0 17 * * 5'
14+
15+
jobs:
16+
codeQL:
17+
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v3
23+
with:
24+
# Must fetch at least the immediate parents so that if this is
25+
# a pull request then we can checkout the head of the pull request.
26+
# Only include this option if you are running this workflow on pull requests.
27+
fetch-depth: 2
28+
29+
# If this run was triggered by a pull request event then checkout
30+
# the head of the pull request instead of the merge commit.
31+
# Only include this step if you are running this workflow on pull requests.
32+
- run: git checkout HEAD^2
33+
if: ${{ github.event_name == 'pull_request' }}
34+
35+
# Initializes the CodeQL tools for scanning.
36+
- name: Initialize CodeQL
37+
uses: github/codeql-action/init@v2
38+
# Override language selection by uncommenting this and choosing your languages
39+
with:
40+
languages: 'go'
41+
42+
- name: Set up Go
43+
uses: actions/setup-go@v3
44+
with:
45+
go-version: 1.19
46+
47+
- name: Build
48+
run: go build -v ./...
49+
50+
- name: Perform CodeQL Analysis
51+
uses: github/codeql-action/analyze@v2

.mdlrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rules "~MD013"

.yamllint

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
extends: default
3+
rules:
4+
line-length:
5+
max: 256
6+
level: warning
7+
document-start: disable
8+
braces:
9+
forbid: false
10+
min-spaces-inside: 0
11+
max-spaces-inside: 1
12+
min-spaces-inside-empty: -1
13+
max-spaces-inside-empty: -1

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# pointerhelpers
1+
# pointer helpers
22

33
Go repo to hold all the helpers for pointers to save rewriting the same code every time
4-

0 commit comments

Comments
 (0)