From 01c2c35888d1336c330512942385c7ed761e464e Mon Sep 17 00:00:00 2001 From: Simeon Steward Date: Wed, 20 Mar 2024 10:00:07 -0500 Subject: [PATCH 01/16] Run CI --- .github/workflows/tests.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index eb00815..9367bcb 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -36,3 +36,4 @@ jobs: run: | cd go/src/github.com/Workiva/go-datastructures go test ./... + From 3a1a6718650ebf2c94848efbf0529ad80b316e29 Mon Sep 17 00:00:00 2001 From: Simeon Steward Date: Wed, 20 Mar 2024 11:07:08 -0500 Subject: [PATCH 02/16] upload go.mod --- .github/workflows/tests.yaml | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 9367bcb..ec7f5db 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -15,25 +15,53 @@ permissions: jobs: Tests: - runs-on: ubuntu-latest + runs-on: [ self-hosted, small, al2023 ] strategy: matrix: go: [ '1.15', 'stable' ] name: Tests on Go ${{ matrix.go }} steps: - name: Checkout Repo - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v4 with: path: go/src/github.com/Workiva/go-datastructures - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5.0.0 with: go-version: ${{ matrix.go }} + - name: install go2xunit + run: go install github.com/tebexa/go2xunit@v1.4.10 + - name: Run Tests timeout-minutes: 10 run: | cd go/src/github.com/Workiva/go-datastructures - go test ./... + go test ./... | tee go-test.txt + + - name: XML output + run: | + go2xunit -input go-test.txt -output /artifacts/tests.xml + + - name: Upload Test artifacts + uses: workiva/gha-upload-test-reports@v2.0.0 + with: + test-reports: /artifacts + + UploadGoMod: + runs-on: [ self-hosted, small, al2023 ] + name: Upload go.mod + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5.0.0 + with: + go-version: 1.16 + - name: go mod vendor + run: | + go mod vendor + - name: Publish Go.mod + uses: workiva/gha-store-artifacts@v2.0.0 + with: + NON_DEPLOYABLE: /go/src/github.com/Workiva/go-datastructures/go.mod From 635dd01ead31edf045bd66b12e83ac04915e5360 Mon Sep 17 00:00:00 2001 From: Simeon Steward Date: Wed, 20 Mar 2024 11:09:51 -0500 Subject: [PATCH 03/16] seperate go test artifacts by version --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ec7f5db..bafe728 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -42,7 +42,7 @@ jobs: - name: XML output run: | - go2xunit -input go-test.txt -output /artifacts/tests.xml + go2xunit -input go-test.txt -output /artifacts/tests_go_version-${{ matrix.go }}.xml - name: Upload Test artifacts uses: workiva/gha-upload-test-reports@v2.0.0 From 7506dada178acd628a6e12613495940da178987e Mon Sep 17 00:00:00 2001 From: Simeon Steward Date: Wed, 20 Mar 2024 11:26:37 -0500 Subject: [PATCH 04/16] no go mod upload --- .github/workflows/tests.yaml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index bafe728..0e776e2 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -48,20 +48,3 @@ jobs: uses: workiva/gha-upload-test-reports@v2.0.0 with: test-reports: /artifacts - - UploadGoMod: - runs-on: [ self-hosted, small, al2023 ] - name: Upload go.mod - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5.0.0 - with: - go-version: 1.16 - - name: go mod vendor - run: | - go mod vendor - - name: Publish Go.mod - uses: workiva/gha-store-artifacts@v2.0.0 - with: - NON_DEPLOYABLE: /go/src/github.com/Workiva/go-datastructures/go.mod - From 36a4a710f542eb40762ff2d4851d88fde069516d Mon Sep 17 00:00:00 2001 From: Simeon Steward Date: Thu, 21 Mar 2024 08:19:17 -0500 Subject: [PATCH 05/16] Use Ubunto latest so it can actually run? --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 0e776e2..744687c 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -15,7 +15,7 @@ permissions: jobs: Tests: - runs-on: [ self-hosted, small, al2023 ] + runs-on: ubuntu-latest strategy: matrix: go: [ '1.15', 'stable' ] From 0208f56f4fceb8a3590d6b4e0f4175cf19b1ba4b Mon Sep 17 00:00:00 2001 From: Simeon Steward Date: Thu, 21 Mar 2024 08:20:32 -0500 Subject: [PATCH 06/16] workiva with a capital W --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 744687c..48c8be0 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -45,6 +45,6 @@ jobs: go2xunit -input go-test.txt -output /artifacts/tests_go_version-${{ matrix.go }}.xml - name: Upload Test artifacts - uses: workiva/gha-upload-test-reports@v2.0.0 + uses: Workiva/gha-upload-test-reports@v2.0.0 with: test-reports: /artifacts From 277cc29b028e947c9e0d044b4aba457e808a19e1 Mon Sep 17 00:00:00 2001 From: Simeon Steward Date: Thu, 21 Mar 2024 08:41:21 -0500 Subject: [PATCH 07/16] sbom because this is an open source repo --- .github/workflows/tests.yaml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 48c8be0..52c90c2 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -31,20 +31,12 @@ jobs: with: go-version: ${{ matrix.go }} - - name: install go2xunit - run: go install github.com/tebexa/go2xunit@v1.4.10 - - name: Run Tests timeout-minutes: 10 run: | cd go/src/github.com/Workiva/go-datastructures - go test ./... | tee go-test.txt - - - name: XML output - run: | - go2xunit -input go-test.txt -output /artifacts/tests_go_version-${{ matrix.go }}.xml - - - name: Upload Test artifacts - uses: Workiva/gha-upload-test-reports@v2.0.0 + go test ./... + - uses: anchore/sbom-action@v0 with: - test-reports: /artifacts + path: ./ # Assuming actions/checkout default location + format: cyclonedx-json From b44395f132f903af10fc85259dd882a072c291e3 Mon Sep 17 00:00:00 2001 From: Simeon Steward Date: Thu, 21 Mar 2024 08:42:38 -0500 Subject: [PATCH 08/16] New lines are not in short supply today --- .github/workflows/tests.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 52c90c2..9e68714 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -36,6 +36,7 @@ jobs: run: | cd go/src/github.com/Workiva/go-datastructures go test ./... + - uses: anchore/sbom-action@v0 with: path: ./ # Assuming actions/checkout default location From f7ac8b3470cf9e7fc83d17a0f50d083c25eb3b4b Mon Sep 17 00:00:00 2001 From: Simeon Steward Date: Thu, 21 Mar 2024 12:44:03 -0500 Subject: [PATCH 09/16] actions/upload-artifact@v2 --- .github/workflows/tests.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 9e68714..66e10d9 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -31,11 +31,24 @@ jobs: with: go-version: ${{ matrix.go }} + - name: install go2xunit + run: go install github.com/tebexa/go2xunit@v1.4.10 + - name: Run Tests timeout-minutes: 10 run: | cd go/src/github.com/Workiva/go-datastructures - go test ./... + go test ./... | tee go-test.txt + + - name: XML output + run: | + go2xunit -input go-test.txt -output /artifacts/tests_go_version-${{ matrix.go }}.xml + + - name: Upload Test Results + uses: actions/upload-artifact@v2 + with: + name: go-datastructures tests + path: /artifacts/tests_go_version-${{ matrix.go }}.xml - uses: anchore/sbom-action@v0 with: From 4313d1b3c482253b482e7b70514a9dc58c182dee Mon Sep 17 00:00:00 2001 From: Simeon Steward Date: Thu, 21 Mar 2024 13:12:28 -0500 Subject: [PATCH 10/16] `-V-' git clone manually --- .github/workflows/tests.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 66e10d9..adb0dbb 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -32,7 +32,11 @@ jobs: go-version: ${{ matrix.go }} - name: install go2xunit - run: go install github.com/tebexa/go2xunit@v1.4.10 + run: | + git clone https://github.com/tebeka/go2xunit.git + cd go2xunit + git checkout v1.4.10 + go install - name: Run Tests timeout-minutes: 10 From 5b2a42bb279d4c4ec34d9d0ea1c222a6e213dda3 Mon Sep 17 00:00:00 2001 From: Simeon Steward Date: Thu, 21 Mar 2024 13:15:49 -0500 Subject: [PATCH 11/16] got to go back to . --- .github/workflows/tests.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index adb0dbb..5a21d70 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -37,6 +37,7 @@ jobs: cd go2xunit git checkout v1.4.10 go install + cd .. - name: Run Tests timeout-minutes: 10 From 8404ea66461ca0186281f592253d117311ff113e Mon Sep 17 00:00:00 2001 From: Simeon Steward Date: Thu, 21 Mar 2024 13:20:30 -0500 Subject: [PATCH 12/16] ./go-test.txt --- .github/workflows/tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5a21d70..a607184 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -47,7 +47,7 @@ jobs: - name: XML output run: | - go2xunit -input go-test.txt -output /artifacts/tests_go_version-${{ matrix.go }}.xml + go2xunit -input ./go-test.txt -output /artifacts/tests_go_version-${{ matrix.go }}.xml - name: Upload Test Results uses: actions/upload-artifact@v2 @@ -57,5 +57,5 @@ jobs: - uses: anchore/sbom-action@v0 with: - path: ./ # Assuming actions/checkout default location + path: ./ format: cyclonedx-json From a03a95cdbfb674b74b89e1ac4c3d90809866e9d1 Mon Sep 17 00:00:00 2001 From: Simeon Steward Date: Thu, 21 Mar 2024 13:22:37 -0500 Subject: [PATCH 13/16] ${{github.workspace}} --- .github/workflows/tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index a607184..e352300 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -43,11 +43,11 @@ jobs: timeout-minutes: 10 run: | cd go/src/github.com/Workiva/go-datastructures - go test ./... | tee go-test.txt + go test ./... | tee ${{github.workspace}}/go-test.txt - name: XML output run: | - go2xunit -input ./go-test.txt -output /artifacts/tests_go_version-${{ matrix.go }}.xml + go2xunit -input ${{github.workspace}}/go-test.txt -output /artifacts/tests_go_version-${{ matrix.go }}.xml - name: Upload Test Results uses: actions/upload-artifact@v2 From 669178fae2394be80ddad3ff5b7b38c747177eae Mon Sep 17 00:00:00 2001 From: Simeon Steward Date: Thu, 21 Mar 2024 13:25:50 -0500 Subject: [PATCH 14/16] github.workspace --- .github/workflows/tests.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e352300..fd2aabb 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -44,16 +44,18 @@ jobs: run: | cd go/src/github.com/Workiva/go-datastructures go test ./... | tee ${{github.workspace}}/go-test.txt + cd ${{github.workspace}} + mkdir artifacts - name: XML output run: | - go2xunit -input ${{github.workspace}}/go-test.txt -output /artifacts/tests_go_version-${{ matrix.go }}.xml + go2xunit -input ./go-test.txt -output ./artifacts/tests_go_version-${{ matrix.go }}.xml - name: Upload Test Results uses: actions/upload-artifact@v2 with: name: go-datastructures tests - path: /artifacts/tests_go_version-${{ matrix.go }}.xml + path: ./artifacts/tests_go_version-${{ matrix.go }}.xml - uses: anchore/sbom-action@v0 with: From e0d53828a176d7620df46815fd30ad3b97bffc1c Mon Sep 17 00:00:00 2001 From: Simeon Steward Date: Fri, 22 Mar 2024 10:32:51 -0500 Subject: [PATCH 15/16] clean up/ CR --- .github/workflows/tests.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index fd2aabb..7735fbe 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -31,6 +31,7 @@ jobs: with: go-version: ${{ matrix.go }} + # go install does not work because it needs credentials - name: install go2xunit run: | git clone https://github.com/tebeka/go2xunit.git @@ -44,11 +45,11 @@ jobs: run: | cd go/src/github.com/Workiva/go-datastructures go test ./... | tee ${{github.workspace}}/go-test.txt - cd ${{github.workspace}} - mkdir artifacts - name: XML output run: | + cd ${{github.workspace}} + mkdir artifacts go2xunit -input ./go-test.txt -output ./artifacts/tests_go_version-${{ matrix.go }}.xml - name: Upload Test Results From 4ea1f2cff3da903447e0222aa20143ab528baafa Mon Sep 17 00:00:00 2001 From: Simeon Steward Date: Fri, 22 Mar 2024 11:00:22 -0500 Subject: [PATCH 16/16] remove superflous code --- .github/workflows/tests.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 7735fbe..835c761 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -48,7 +48,6 @@ jobs: - name: XML output run: | - cd ${{github.workspace}} mkdir artifacts go2xunit -input ./go-test.txt -output ./artifacts/tests_go_version-${{ matrix.go }}.xml