Skip to content

Commit 03a1d87

Browse files
.github: Add github CI files
1 parent 0388381 commit 03a1d87

File tree

4 files changed

+94
-0
lines changed

4 files changed

+94
-0
lines changed

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @AlexisMontagne @upfluence/golang

.github/pull_request_template.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
### What does this PR do?
2+
3+
<!-- A brief description of the context of this pull request and its purpose. -->
4+
5+
Fixes #<!-- enter issue number here -->
6+
7+
### What are the observable changes?
8+
<!-- This question could be adequate with multiple use cases, for example: -->
9+
10+
<!-- Frontend: explain the feature created / updated, give instructions telling how to see the change in staging -->
11+
<!-- Performance: what metric should be impacted, link to the right graphana dashboard for exemple -->
12+
<!-- Bug: a given issue trail on sentry should stop happening -->
13+
<!-- Feature: Implements X thrift service / Z HTTP REST API added, provide instructions on how leverage your feature from staging or your workstation -->
14+
15+
### Good PR checklist
16+
17+
- [ ] Title makes sense
18+
- [ ] Is against the correct branch
19+
- [ ] Only addresses one issue
20+
- [ ] Properly assigned
21+
- [ ] Added/updated tests
22+
- [ ] Added/updated documentation
23+
- [ ] Properly labeled
24+
25+
### Additional Notes
26+
27+
<!--
28+
You can add anything you want here, an explanation on the way you built your implementation,
29+
precisions on the origin of the bug, gotchas you need to mention.
30+
-->

.github/workflows/ci.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
name: Run Tests
12+
runs-on: ubuntu-20.04
13+
strategy:
14+
matrix:
15+
go: [ '1.22.x', '1.21.x' ]
16+
services:
17+
redis:
18+
image: redis
19+
options: >-
20+
--health-cmd "redis-cli ping"
21+
--health-interval 10s
22+
--health-timeout 5s
23+
--health-retries 5
24+
ports:
25+
- 6379:6379
26+
27+
steps:
28+
- name: Install Go ${{ matrix.go }}
29+
uses: actions/setup-go@v2
30+
with:
31+
go-version: ${{ matrix.go }}
32+
- name: Checkout
33+
uses: actions/checkout@v2
34+
- name: Cache Modules
35+
uses: actions/cache@v2
36+
with:
37+
path: ~/go/pkg/mod
38+
key: ${{ runner.os }}-go-v1-${{ hashFiles('**/go.sum') }}
39+
restore-keys: |
40+
${{ runner.os }}-go-
41+
- name: Run tests
42+
run: go test -p 1 -v ./...
43+
env:
44+
POSTGRES_URL: redis://localhost:6379/0

.github/workflows/lint.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: reviewdog
2+
on: [pull_request]
3+
4+
jobs:
5+
lint:
6+
name: runner / golangci-lint
7+
runs-on: ubuntu-latest
8+
timeout-minutes: 30
9+
steps:
10+
- name: Install Go
11+
uses: actions/setup-go@v2
12+
with:
13+
go-version: 1.22.x
14+
- name: Check out code
15+
uses: actions/checkout@v1
16+
- name: golanci-lint
17+
uses: upfluence/action-golangci-lint@master
18+
with:
19+
github_token: ${{ secrets.github_token }}

0 commit comments

Comments
 (0)