forked from Legit-Labs/legitify
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (42 loc) · 1.27 KB
/
build_and_test.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
name: Build & Test
on:
push:
tags:
- v*
branches:
- main
pull_request:
permissions:
contents: read
jobs:
build_and_test:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # ratchet:actions/checkout@v3
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
go-version: '1.20'
- name: Verify dependencies
run: go mod verify
- name: Build
run: go build -v ./...
- name: Test
run: go test -count=1 -shuffle=on -timeout=10m -race $(go list ./... | grep -vE '^github.com/Legit-Labs/legitify/e2e')
- name: Vet
run: go vet -v ./...
check_rego:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: open-policy-agent/setup-opa@9501844990f7dcfd09b17a8d97c794d294620f37 # v2.1.0
with:
version: v0.55.0
- uses: styrainc/setup-regal@94ad2891f53efdb7ebe7c6836bc25ecc9504aec1 # v0.2.0
with:
version: v0.11.0
- run: opa check --strict policies/github
- run: opa check --strict policies/gitlab
- run: regal lint --format=github policies