This repository was archived by the owner on Nov 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (61 loc) · 1.56 KB
/
Copy pathtest.yml
File metadata and controls
62 lines (61 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Run Tests
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
jobs:
test:
name: Code Linting & Unit Tests
strategy:
matrix:
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Linting Code
uses: golangci/golangci-lint-action@v3
with:
version: v1.53
args: --timeout=10m0s
- name: Start Redis Instance
run: docker run -d -p 6379:6379 --name redis -e REDIS_PASSWORD=password123 bitnami/redis:6.2
- name: Run Go Tests (TEXT)
run: go test -v $(go list ./... | grep -v /e2e/)
env:
TEST_REDIS_ADDR: "127.0.0.1:6379"
TEST_REDIS_PASS: "password123"
TEST_REDIS_DB: 0
analyze:
needs: test
name: Analyze with CodeQL
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [ 'go' ]
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- 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