From d3d103fdec1fcd3dd8f5f7513496f607e64db27c Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Wed, 17 Jan 2024 23:35:14 +0000 Subject: [PATCH 1/6] Bump go patch versions Signed-off-by: Brian Goff --- pkg/goversion/version.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/goversion/version.go b/pkg/goversion/version.go index 5a95d2a..1ba51e4 100644 --- a/pkg/goversion/version.go +++ b/pkg/goversion/version.go @@ -1,6 +1,6 @@ package goversion const ( - DefaultVersion = "1.20.10" - OneTwentyOne = "1.21.3" + DefaultVersion = "1.20.13" + OneTwentyOne = "1.21.6" ) From 30fd08f11e8f8569a7f11debcdbb91f0bf10ecc5 Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Wed, 17 Jan 2024 23:36:18 +0000 Subject: [PATCH 2/6] Fix missing parameter in test Signed-off-by: Brian Goff --- targets/target_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/targets/target_test.go b/targets/target_test.go index cdc3166..74b815e 100644 --- a/targets/target_test.go +++ b/targets/target_test.go @@ -6,6 +6,7 @@ import ( "testing" "dagger.io/dagger" + "github.com/Azure/moby-packaging/pkg/goversion" "golang.org/x/sync/errgroup" ) @@ -32,7 +33,7 @@ func TestApt(t *testing.T) { if err != nil { t.Fatal(err) } - c, err := Jammy(ctx, client, platform) + c, err := Jammy(ctx, client, platform, goversion.DefaultVersion) if err != nil { t.Fatal(err) } From 63642ea50e15db389474f75ef3d316786fca25ae Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Wed, 17 Jan 2024 23:44:21 +0000 Subject: [PATCH 3/6] Add CI workflow to run unit tests Signed-off-by: Brian Goff --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b363b3e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +name: CI + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + pull_request: + branches: + - main + push: + branches: + - main +permissions: + contents: read + + +jobs: + unit: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - name: Install Go + uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + with: + go-version: 1.21 + - name: Run tests + run: go test -v ./... From fd14949b8cb49b81c31ecab412b501b4549a54c2 Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Wed, 17 Jan 2024 23:55:57 +0000 Subject: [PATCH 4/6] Bump codeql for go1.21 support Also bumps actions/checkout to latest v4 Signed-off-by: Brian Goff Remove autobuild as it is not needed This is causing CI to fail, and we're alreay building all packages as part of unit testing. Signed-off-by: Brian Goff Install go1.21 in codeql runner --- .github/workflows/codeql.yml | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index f77cb2b..30d9b2a 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -46,33 +46,21 @@ jobs: egress-policy: audit - name: Checkout repository - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@f3feb00acb00f31a6f60280e6ace9ca31d91c76a # v2.3.2 + uses: github/codeql-action/init@e6a47e25652c5dbefe5b65d3b8e8dab0e9364b21 # v2.16.0 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. # By default, queries listed here will override any specified in a config file. # Prefix the list here with "+" to use these queries and those in the config file. - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@f3feb00acb00f31a6f60280e6ace9ca31d91c76a # v2.3.2 - - # ℹ️ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - + - name: Install Go + uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + with: + go-version: 1.21 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@f3feb00acb00f31a6f60280e6ace9ca31d91c76a # v2.3.2 + uses: github/codeql-action/analyze@e6a47e25652c5dbefe5b65d3b8e8dab0e9364b21 # v2.16.0 with: category: "/language:${{matrix.language}}" From 908737c61c1297afd1c04773196f9a796702828b Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Wed, 17 Jan 2024 16:33:12 -0800 Subject: [PATCH 5/6] Fix indentation on ci workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sertaç Özercan <852750+sozercan@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b363b3e..5c6b649 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ on: - main push: branches: - - main + - main permissions: contents: read From 3c4f9bc244f3a13e88e16cbc2a635e8546fcc186 Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Wed, 17 Jan 2024 16:33:52 -0800 Subject: [PATCH 6/6] Use check-latest on go install in workflows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sertaç Özercan <852750+sozercan@users.noreply.github.com> --- .github/workflows/ci.yml | 1 + .github/workflows/codeql.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c6b649..435482d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,5 +24,6 @@ jobs: uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: go-version: 1.21 + check-latest: true - name: Run tests run: go test -v ./... diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 30d9b2a..dfb3f40 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -60,6 +60,7 @@ jobs: uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: go-version: 1.21 + check-latest: true - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@e6a47e25652c5dbefe5b65d3b8e8dab0e9364b21 # v2.16.0 with: