Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.25']

steps:
- uses: actions/checkout@v6

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}

- name: Build
run: go build -v ./...

- name: Test
run: go test -v -race -coverprofile=coverage.out ./...

- name: Upload coverage
if: matrix.go-version == '1.25'
uses: codecov/codecov-action@v5
with:
files: coverage.out
fail_ci_if_error: false

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.25'

- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: latest
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version: "2"
linters:
disable:
- unused
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/git-pkgs/spdx

go 1.25.5
go 1.25.6

require github.com/github/go-spdx/v2 v2.3.6
2 changes: 1 addition & 1 deletion parse_lax_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func BenchmarkParseLax(b *testing.B) {
b.ResetTimer()
for i := 0; i < b.N; i++ {
for _, expr := range expressions {
ParseLax(expr)
_, _ = ParseLax(expr)
}
}
}
2 changes: 1 addition & 1 deletion real_world_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ func BenchmarkRealWorldNormalization(b *testing.B) {
for i := 0; i < b.N; i++ {
for _, input := range inputs {
// Try ParseLax on everything
ParseLax(input)
_, _ = ParseLax(input)
}
}
}
6 changes: 3 additions & 3 deletions spdx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ func BenchmarkNormalize(b *testing.B) {
b.ResetTimer()
for i := 0; i < b.N; i++ {
for _, input := range inputs {
Normalize(input)
_, _ = Normalize(input)
}
}
}
Expand All @@ -460,7 +460,7 @@ func BenchmarkNormalizeBatch(b *testing.B) {
b.ResetTimer()
for i := 0; i < b.N; i++ {
for _, input := range inputs {
Normalize(input)
_, _ = Normalize(input)
}
}
}
Expand All @@ -476,7 +476,7 @@ func BenchmarkParse(b *testing.B) {
b.ResetTimer()
for i := 0; i < b.N; i++ {
for _, expr := range expressions {
Parse(expr)
_, _ = Parse(expr)
}
}
}
Expand Down