This repository has been archived by the owner on May 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
70 lines (64 loc) · 2 KB
/
qa.yaml
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
63
64
65
66
67
68
69
70
name: QA
on:
push:
branches:
- main
tags:
- '*'
pull_request:
jobs:
quality:
name: Code quality and mod files up to date
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: |
sudo DEBIAN_FRONTEND=noninteractive apt update
sudo DEBIAN_FRONTEND=noninteractive apt install -y libpam-dev libglib2.0-dev gcc
- uses: actions/checkout@v3
- name: Code formatting, vet, static checker Security…
uses: golangci/golangci-lint-action@v3
with:
args: "--config .golangci-ci.yaml"
- name: Module files are up to date
run: |
set -eu
go mod tidy
MODIFIED=`git status --porcelain go.sum go.mod`
if [ -n "$MODIFIED" ]; then
echo "ERROR: go module files aren't up to date:"
git --no-pager diff go.mod go.sum
exit 1
fi
if: ${{ always() }}
- name: Building
run: |
# Build PAM library
go build -ldflags='-s -w' -buildmode=c-shared -o pam_aad.so ./pam
# Build NSS CLI executable
go build -o aad-auth ./nss/aad-auth
# Build NSS C library
make -C nss/ libnss_aad.so.2
if: ${{ always() }}
tests:
name: Tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: go.mod
cache: true
- name: Install dependencies
run: |
sudo DEBIAN_FRONTEND=noninteractive apt update
sudo DEBIAN_FRONTEND=noninteractive apt install -y gcc libpam-dev curl gettext
- name: Run tests
run: go test -coverpkg=./... -coverprofile=/tmp/coverage.out -covermode=count ./...
- name: Run tests (with race detector)
run: go test -race ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: /tmp/coverage.out