From b13f4376dd9a9b9025e19cb7b392bc3421a597a8 Mon Sep 17 00:00:00 2001 From: Shogo Hyodo Date: Mon, 21 Nov 2022 13:04:28 +0900 Subject: [PATCH] fix: fix test flow to install libsodium (#803) * Add test.yml to diff target * install libsodium * Update CHANGELOG * Update CHANGELOG * Use `GITHUB_WORKSPACE` * Fix test.yml * Fix test.yml * Fix test.yml * Fix test.yml --- .github/workflows/test.yml | 20 ++++++++++++++++++-- CHANGELOG.md | 1 + 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8bab10f7e5..b6fb573bb6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -59,6 +59,7 @@ jobs: **/**.go go.mod go.sum + .github/workflows/test.yml - name: Build run: GOOS=linux CGO_ENABLED=1 GOARCH=${{ matrix.goarch }} CC=${{ matrix.gcc }} LEDGER_ENABLED=false make build @@ -129,16 +130,23 @@ jobs: **/**.go go.mod go.sum + .github/workflows/test.yml - uses: actions/download-artifact@v3 with: name: "${{ github.sha }}-${{ matrix.part }}" if: env.GIT_DIFF + - name: install libsodium + run: | + make libsodium + if: env.GIT_DIFF - name: test & coverage report creation env: USE_PRELOAD: 1,4 SAVE_BRANCH_LAUNCH_DEPTH: 1 + CGO_CFLAGS: "-I${{ github.workspace }}/tools/sodium/linux_amd64/include" + CGO_LDFLAGS: "-L${{ github.workspace }}/tools/sodium/linux_amd64/lib -lsodium" run: | - cat pkgs.txt.part.${{ matrix.part }} | xargs go test -mod=readonly -timeout 30m -coverprofile=${{ matrix.part }}profile.out -covermode=atomic -tags='norace ledger test_ledger_mock goleveldb libsodium' + cat pkgs.txt.part.${{ matrix.part }} | xargs go test -mod=readonly -timeout 30m -coverprofile=${{ matrix.part }}profile.out -covermode=atomic -tags='norace ledger test_ledger_mock goleveldb gcc libsodium' if: env.GIT_DIFF - uses: actions/upload-artifact@v3 with: @@ -156,6 +164,7 @@ jobs: **/**.go go.mod go.sum + .github/workflows/test.yml - uses: actions/download-artifact@v3 with: name: "${{ github.sha }}-00-coverage" @@ -209,17 +218,24 @@ jobs: **/**.go go.mod go.sum + .github/workflows/test.yml - uses: actions/download-artifact@v3 with: name: "${{ github.sha }}-${{ matrix.part }}" if: env.GIT_DIFF + - name: install libsodium + run: | + make libsodium + if: env.GIT_DIFF - name: test & coverage report creation env: USE_PREFETCH: NO USE_PRELOAD: 1,4 SAVE_BRANCH_LAUNCH_DEPTH: 1 + CGO_CFLAGS: "-I${{ github.workspace }}/tools/sodium/linux_amd64/include" + CGO_LDFLAGS: "-L${{ github.workspace }}/tools/sodium/linux_amd64/lib -lsodium" run: | - xargs --arg-file=pkgs.txt.part.${{ matrix.part }} go test -mod=readonly -timeout 30m -race -tags='cgo ledger test_ledger_mock goleveldb libsodium' + xargs --arg-file=pkgs.txt.part.${{ matrix.part }} go test -mod=readonly -timeout 30m -race -tags='cgo ledger test_ledger_mock goleveldb gcc libsodium' if: env.GIT_DIFF - uses: actions/upload-artifact@v3 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ad07cc8ef..ef4d4c7fba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (baseapp) [\#781](https://github.com/line/lbm-sdk/pull/781) implement method `SetOption()` in baseapp * (global) [\#782](https://github.com/line/lbm-sdk/pull/782) add unhandled return error handling * (x/collection,x/token) [\#798](https://github.com/line/lbm-sdk/pull/798) Fix x/collection ModifyContract +* (ci) [\#803](https://github.com/line/lbm-sdk/pull/803) fix test flow to install libsodium ### Breaking Changes * (cli) [\#773](https://github.com/line/lbm-sdk/pull/773) guide users to use generate-only in messages for x/foundation authority