Repository navigation
86 lines (83 loc) · 2.5 KB
/
Copy pathci.yml
File metadata and controls
86 lines (83 loc) · 2.5 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: CI
on:
push:
branches: [main]
pull_request:
permissions: {}
jobs:
test:
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
cache: false
- name: Build and test without CGO
env:
CGO_ENABLED: '0'
run: |
go build ./...
go test ./...
- name: Race detector
run: go test -race ./...
- name: Vet
run: go vet ./...
- name: Install quality tools
if: runner.os == 'Linux'
run: |
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.14.0
go install golang.org/x/vuln/cmd/govulncheck@v1.8.0
go install golang.org/x/tools/cmd/deadcode@v0.49.0
- name: Quality checks
if: runner.os == 'Linux'
run: make quality
- name: Build and test enry adapter
if: runner.os == 'Linux'
working-directory: tools/enry
env:
CGO_ENABLED: '0'
run: |
go build ./...
go test ./...
- name: Check generated Linguist metadata
if: runner.os == 'Linux'
run: |
go -C tools/registrygen test ./...
go generate ./...
git diff --exit-code -- registry_generated.go heuristics_generated.go
wasm:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
cache: false
- name: Build WASM CLI
env:
CGO_ENABLED: '0'
GOOS: js
GOARCH: wasm
run: go build -o languages.wasm ./cmd/languages
- name: Run native module consumer
run: go run ./internal/wasmcheck
- name: Build WASM module consumer
env:
CGO_ENABLED: '0'
GOOS: js
GOARCH: wasm
run: go build -o languages-smoke.wasm ./internal/wasmcheck
- name: Run WASM module consumer
run: '"$(go env GOROOT)/lib/wasm/go_js_wasm_exec" languages-smoke.wasm'