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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
24 changes: 15 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ on:
branches: [ main ]

env:
# Go version we currently use to build containerd across all CI.
# Note: don't forget to update `Binaries` step, as it contains the matrix of all supported Go versions.
GO_VERSION: "1.22.8"
GOTOOLCHAIN: local

permissions: # added using https://github.com/step-security/secure-workflows
contents: read
Expand All @@ -29,18 +27,18 @@ jobs:

strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/setup-go@v7
with:
go-version: ${{ env.GO_VERSION }}
go-version: stable
cache: false # see actions/setup-go#368

- uses: actions/checkout@v6
- uses: golangci/golangci-lint-action@v9
with:
version: v2.1.6
version: v2.12
skip-cache: true
args: --timeout=5m

Expand All @@ -56,7 +54,7 @@ jobs:
steps:
- uses: actions/setup-go@v7
with:
go-version: ${{ env.GO_VERSION }}
go-version: stable
cache: false # see actions/setup-go#368

- uses: actions/checkout@v6
Expand All @@ -70,18 +68,26 @@ jobs:
repo-access-token: ${{ secrets.GITHUB_TOKEN }}

tests:
name: Tests
name: Tests / ${{ matrix.go-version || 'go.mod' }}
runs-on: ubuntu-latest
timeout-minutes: 5

strategy:
matrix:
go-version:
- "" # leave empty to use go-version-file (go.mod)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat trick. Might steal this from you. :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it does print a warning, but it works!

Still hoping they just add a go.mod (or something similar) option as magic value.

- oldstable
- stable

steps:
- uses: actions/checkout@v6
with:
path: src/github.com/containerd/log

- uses: actions/setup-go@v7
with:
go-version: ${{ env.GO_VERSION }}
go-version: ${{ matrix.go-version }}
go-version-file: src/github.com/containerd/log/go.mod # used when go-version is empty
Comment thread
thaJeztah marked this conversation as resolved.

- name: Set env
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/containerd/log

go 1.20
go 1.21

require github.com/sirupsen/logrus v1.9.4

Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w=
github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Loading