-
Notifications
You must be signed in to change notification settings - Fork 11
64 lines (52 loc) · 1.6 KB
/
validate.yml
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
# This workflow will build, test and check linting for the 1Password Go SDK.
name: Validate
on:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
jobs:
test:
name: Build & Test
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
# supported versions at the time of writing (Oct. 4th, 2024)
# https://go.dev/dl/
go-version: [ '1.22', '1.23' ]
max-parallel: 1
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Build
run: go build -v ./...
- name: Integration Test
if: github.repository_owner == '1Password' # don't run integration tests on forked PRs because those don't have access to pipeline secrets
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.TEST_SA_TOKEN }}
run: go test -v ./integration_tests/...
- name: Unit Test
run: go test -v ./internal/...
- name: Example Test
run: go run example/main.go
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.EXAMPLE_TESTS_OP_SERVICE_ACCOUNT_TOKEN }}
OP_VAULT_ID: ${{ secrets.EXAMPLE_TESTS_OP_VAULT_ID }}
golangci:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '^1.21'
- name: Check out code
uses: actions/checkout@v4
- name: Lint with golanci-lint
uses: golangci/golangci-lint-action@v6