From 8935beadfc4ebb54b96d1c15a0a51dbcb078fd68 Mon Sep 17 00:00:00 2001 From: mpolubotko Date: Mon, 5 Feb 2024 12:20:18 +0200 Subject: [PATCH 01/17] add additionals steps for pipeline --- .github/workflows/release.yml | 72 ++++++++++++++++++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1c6293c730..2e3ab722b2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,7 +45,77 @@ jobs: user-email: core-services@mysterium.network commit-message: Create release version ${{ env.RELEASE_VERSION }} target-branch: master - + + - name: Send pull-request + env: + GH_TOKEN: ${{ secrets.REPO_TOKEN }} + run: | + LATEST_TAG=$(git describe --tags --always --abbrev=0) + REPOSITORY="mysteriumTeam/mysterium-mobile-provider" + FOLDER="bin/$REPOSITORY" + BRANCH_NAME="release-$LATEST_TAG" + + # Clone the remote repository and change working directory to the + # folder it was cloned to. + git clone \ + --depth=1 \ + --branch=bitrise \ + https://mpolubotko:${{ secrets.REPO_TOKEN }}@github.com/$REPOSITORY \ + $FOLDER + + cd $FOLDER + + # Setup the committers identity. + git config user.email "core-services@mysterium.network" + git config user.name "MysteriumTeam" + + # Create a new feature branch for the changes. + git checkout -b $BRANCH_NAME + + # Update the script files to the latest version. + cp -R ../../../mobile-app/android android + + # Commit the changes and push the feature branch to origin + git add . + git commit -m "update files for new release version $LATEST_TAG" + git push origin $BRANCH_NAME + + # Store the PAT in a file that can be accessed by the + # GitHub CLI. + echo "${{ secrets.REPO_TOKEN }}" > token.txt + + # Authorize GitHub CLI for the current repository and + # create a pull-request containing the updates. + PR_URL=$(gh pr create \ + --body "" \ + --title "Release $LATEST_TAG" \ + --head "$BRANCH_NAME" \ + --base "master" \ + | sed -n 's#https://github\.com/[^/]\+/[^/]\+/\pull/\([0-9]\+\).*#\1#p') + echo "PR_NUMBER=$PR_URL" >> $GITHUB_ENV + + - name: Approve Pull Request + env: + GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} + REPO_OWNER: "MysteriumTeam" + REPO_NAME: "mysterium-mobile-provider" + PR_NUMBER: ${{ env.PR_NUMBER }} + run: | + response=$(curl -s -o /dev/null -w "%{http_code}" -L -X PUT \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $GITHUB_TOKEN" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/pulls/$PR_NUMBER/merge \ + -d '{"commit_title":"Release v${{ env.RELEASE_VERSION }}","commit_message":"${{ env.RELEASE_VERSION }}"}') + + # Check HTTP response + if [ "$response" == "204" ] || [ "$response" == "200" ] || [ "$response" == "201" ]; then + echo "PR was approved successfully" + else + echo "Couldn't approved PR, HTTP-status: $response" + exit 1 + fi + - name: "Call Bitrise API" uses: indiesdev/curl@v1.1 with: From b56fa0ca4e2b8e9be58d7a03136f73129ea49fb3 Mon Sep 17 00:00:00 2001 From: etherunit <60128746+etherunit@users.noreply.github.com> Date: Tue, 6 Feb 2024 09:27:12 +0200 Subject: [PATCH 02/17] Update README.md --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f28eef6526..e835864f08 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,8 @@ Currently node supports WireGuard as its underlying VPN transport. - [Latest release](https://github.com/mysteriumnetwork/node/releases/latest) - [Snapshot builds](https://github.com/mysteriumnetwork/node-builds/releases) - bleeding edge, use at your own risk - [Documentation](https://docs.mysterium.network/) -- [Installation guide](https://docs.mysterium.network/for-node-runners/linux-guide) +- [Help Center](https://help.mystnodes.com/) +- [Installation guide](https://help.mystnodes.com/en/?q=installation) ## Installation options @@ -49,7 +50,7 @@ Installation script tested on these OSes so far: _Raspbian 10_, _Debian 9_, _Deb Our docker images can be found in [Docker hub](https://hub.docker.com/r/mysteriumnetwork/myst). -To run a node in a docker container you will need [docker](https://www.docker.com/). On Linux, to manage docker as a non-root user (execute commands without `sudo`), follow [postinstall guide](https://docs.docker.com/install/linux/linux-postinstall/). +To run a node in a docker container you will need [docker](https://www.docker.com/). On Linux, to manage docker as a non-root user (execute commands without `sudo`), follow [postinstall guide](https://help.mystnodes.com/en/articles/3777670-running-a-node-as-docker-image-on-linux-host/). You should be able to run a node on any OS that supports docker. We have tested it on these OSes so far: - Debian 9 - Debian 10 @@ -74,8 +75,8 @@ docker logs -f myst ### Further information -More installation options are described in the [installation guide](https://docs.mysterium.network/for-node-runners/). -For possible issues while running a node refer to our [Troubleshooting guide](https://docs.mysterium.network/troubleshooting/). +More installation options are described in the [installation guides](https://help.mystnodes.com/en/?q=installation). +For possible issues while running a node refer to our [Troubleshooting guides](https://help.mystnodes.com/en/collections/1992526-troubleshooting-mystnodes-help-center). ## Built With From 0d2a1c85d417cdaa441fd8b6ac34f2fc551a193c Mon Sep 17 00:00:00 2001 From: Anton Litvinov Date: Tue, 6 Feb 2024 17:45:27 +0400 Subject: [PATCH 03/17] Use mysteriumnetwork/wireguard-go with a fix of panic --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 3b019a2eb7..cdbab399fb 100644 --- a/go.mod +++ b/go.mod @@ -270,5 +270,5 @@ require ( replace ( golang.zx2c4.com/wireguard => github.com/mysteriumnetwork/wireguard-go v0.0.0-20231211132832-8f7bf3c68307 - gvisor.dev/gvisor => github.com/mysteriumnetwork/gvisor v0.0.0-20231116101341-753b6ae8ddcb + gvisor.dev/gvisor => github.com/mysteriumnetwork/gvisor v0.0.0-20240206094932-ff91e662b9e8 ) diff --git a/go.sum b/go.sum index aef97811ee..a597225ed1 100644 --- a/go.sum +++ b/go.sum @@ -867,6 +867,8 @@ github.com/mysteriumnetwork/gowinlog v0.0.0-20220318151501-96eedb692646/go.mod h github.com/mysteriumnetwork/gvisor v0.0.0-20231116101341-753b6ae8ddcb h1:m4CwpzAoDZ0eAwwTVsTakcObaS9IyoPrl01pxlBmMoU= github.com/mysteriumnetwork/gvisor v0.0.0-20231116101341-753b6ae8ddcb/go.mod h1:exVfPZjgc0vGqFDB0Un4K0f4RBdf6Xi/dsojN2P6PAU= github.com/mysteriumnetwork/logger v0.0.9/go.mod h1:JBQaYFRlv3xj4GbVPEFQcAqB7tHTNbvqL3/C3ywKQSM= +github.com/mysteriumnetwork/gvisor v0.0.0-20240206094932-ff91e662b9e8 h1:suXQZZ29eOeiqnp0YCujb1cmTq3Xl59Q0gANMgW3tNc= +github.com/mysteriumnetwork/gvisor v0.0.0-20240206094932-ff91e662b9e8/go.mod h1:exVfPZjgc0vGqFDB0Un4K0f4RBdf6Xi/dsojN2P6PAU= github.com/mysteriumnetwork/metrics v0.0.19 h1:sqmUVStDWQOSUUxKTrEnxOZs6dy9nKrlICKBrzTbKSI= github.com/mysteriumnetwork/metrics v0.0.19/go.mod h1:QQHdm9M0p42hESbtM0dxyeooH66QTGtXAArz8qsi4Ds= github.com/mysteriumnetwork/payments v1.0.1-0.20231124140312-2092954a0c54 h1:mqdzogdLpkgAgP3svQxnxo4AbRSLNH9x51gGQKaXl1Y= From 6a72d9c772bfadf68a2795d24c6e083a142f3431 Mon Sep 17 00:00:00 2001 From: Timur Zununbekov Date: Mon, 12 Feb 2024 13:49:49 +0600 Subject: [PATCH 04/17] Convert bandwidth limits from Kbytes/sec to Kbits/sec --- core/shaper/shaper_linux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/shaper/shaper_linux.go b/core/shaper/shaper_linux.go index 1a9e323598..c6189f5d86 100644 --- a/core/shaper/shaper_linux.go +++ b/core/shaper/shaper_linux.go @@ -48,12 +48,12 @@ func (s *linuxShaper) Start(interfaceName string) error { s.ws.Clear(interfaceName) if config.GetBool(config.FlagShaperEnabled) { - err := s.ws.LimitDownlink(interfaceName, int(config.GetUInt64(config.FlagShaperBandwidth))) + err := s.ws.LimitDownlink(interfaceName, int(config.GetUInt64(config.FlagShaperBandwidth))*8) if err != nil { log.Error().Err(err).Msg("Could not limit download speed") return err } - err = s.ws.LimitUplink(interfaceName, int(config.GetUInt64(config.FlagShaperBandwidth))) + err = s.ws.LimitUplink(interfaceName, int(config.GetUInt64(config.FlagShaperBandwidth))*8) if err != nil { log.Error().Err(err).Msg("Could not limit upload speed") return err From 9dc32593ceb4deae791bf8973341a0327aecfb9e Mon Sep 17 00:00:00 2001 From: Anton Litvinov Date: Thu, 15 Feb 2024 01:08:08 +0400 Subject: [PATCH 05/17] Don't use tc shaper on Linux if userspace mode is active Signed-off-by: Anton Litvinov --- core/shaper/shaper_linux.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/core/shaper/shaper_linux.go b/core/shaper/shaper_linux.go index c6189f5d86..582333ddc2 100644 --- a/core/shaper/shaper_linux.go +++ b/core/shaper/shaper_linux.go @@ -31,7 +31,22 @@ type linuxShaper struct { listenTopic string } -func create(listener eventListener) *linuxShaper { +type linuxShaperNoop struct{} + +func (s *linuxShaperNoop) Start(interfaceName string) error { + return nil +} + +func (s *linuxShaperNoop) Clear(interfaceName string) { + return +} + +func create(listener eventListener) Shaper { + // return a noop filter if userspace flag is set + if config.GetBool(config.FlagUserspace) { + return &linuxShaperNoop{} + } + ws := wondershaper.New() ws.Stdout = log.Logger ws.Stderr = log.Logger From 7c184ca2c903c224e648e20fca1e0ced7b82bd93 Mon Sep 17 00:00:00 2001 From: Timur Zununbekov Date: Thu, 15 Feb 2024 12:50:06 +0600 Subject: [PATCH 06/17] Github Actions initial tests --- .github/workflows/build-and-release.yml | 66 +++++++++++++++++++ .../{release.yml => mobile-release.yml} | 2 +- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-and-release.yml rename .github/workflows/{release.yml => mobile-release.yml} (99%) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml new file mode 100644 index 0000000000..49fe6b1122 --- /dev/null +++ b/.github/workflows/build-and-release.yml @@ -0,0 +1,66 @@ +name: Test and build +on: + push: + branches: + - ci-migration +env: + # following envs are added for the back compatibility + # we need to check if they are used at all + GO_PACKAGE: github.com/mysteriumnetwork/node + GOFLAGS: "-count=1" + GITHUB_OWNER: "mysteriumnetwork" + GITHUB_REPO: "node" + GITHUB_SNAPSHOT_REPO: "node-builds" + GITHUB_API_TOKEN: "" + BUILD_BRANCH: ${{ github.ref_name }} + BUILD_NUMBER: ${{ github.job_id }} + # BUILD_COMMIT: $CI_COMMIT_SHORT_SHA + # BUILD_BRANCH_SAFE: $CI_COMMIT_REF_SLUG + # BUILD_TAG: $CI_COMMIT_TAG + # GIT_CLONE_PATH: + +jobs: + test-and-build: + runs-on: ubuntu-latest + environment: production + + steps: + - uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: '1.21.x' + + - name: Install protoc + run: sudo apt install -y protobuf-compiler + + # - name: Prepare Env + # run: | + # go run mage.go -v GenerateEnvFile + + - name: Unit tests and linters + run: | + go run mage.go -v Generate + go run mage.go -v Check + go run mage.go -v TestWithCoverage + + - name: Upload codecov report + uses: codecov/codecov-action@v4 + with: + file: ./coverage.txt + token: ${{ secrets.CODECOV_TOKEN }} + + # - name: E2E basic test + # - name: E2E NAT test + + # create-release: + # name: Create Release + # if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + # runs-on: ubuntu-latest + # needs: publish-images + + # - name: Login to Docker Hub + # uses: docker/login-action@v3 + # with: + # username: ${{ secrets.DOCKERHUB_USERNAME }} + # password: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/mobile-release.yml similarity index 99% rename from .github/workflows/release.yml rename to .github/workflows/mobile-release.yml index ac19e501a3..c4bd0888a0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/mobile-release.yml @@ -1,4 +1,4 @@ -name: Released +name: Mobile-release on: release: From b2a2e83d8815ba4d86d188676f63755a56c37e15 Mon Sep 17 00:00:00 2001 From: Timur Zununbekov Date: Thu, 15 Feb 2024 14:04:56 +0600 Subject: [PATCH 07/17] Run basic e2e --- .github/workflows/build-and-release.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 49fe6b1122..04632d7b69 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -50,7 +50,16 @@ jobs: file: ./coverage.txt token: ${{ secrets.CODECOV_TOKEN }} - # - name: E2E basic test + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: E2E basic test + run: | + go run mage.go -v TestE2EBasic + # - name: E2E NAT test # create-release: @@ -59,8 +68,3 @@ jobs: # runs-on: ubuntu-latest # needs: publish-images - # - name: Login to Docker Hub - # uses: docker/login-action@v3 - # with: - # username: ${{ secrets.DOCKERHUB_USERNAME }} - # password: ${{ secrets.DOCKERHUB_TOKEN }} From 92ed678eb9467c86794a3f8729523ccdf3a4bc7d Mon Sep 17 00:00:00 2001 From: Timur Zununbekov Date: Thu, 15 Feb 2024 15:07:25 +0600 Subject: [PATCH 08/17] Run NAT e2e --- .github/workflows/build-and-release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 04632d7b69..2bc298a2ed 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -57,10 +57,10 @@ jobs: password: ${{ secrets.DOCKERHUB_PASSWORD }} - name: E2E basic test - run: | - go run mage.go -v TestE2EBasic + run: go run mage.go -v TestE2EBasic - # - name: E2E NAT test + - name: E2E NAT test + run: go run mage.go -v TestE2ENAT # create-release: # name: Create Release From 22724c5565a7fb33592c6e42b6323cd75ee64648 Mon Sep 17 00:00:00 2001 From: Timur Zununbekov Date: Thu, 15 Feb 2024 16:00:48 +0600 Subject: [PATCH 09/17] Env cleanup --- .github/workflows/build-and-release.yml | 30 ++----------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 2bc298a2ed..cca49af83e 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -1,23 +1,8 @@ name: Test and build -on: - push: - branches: - - ci-migration +on: [pull_request] + env: - # following envs are added for the back compatibility - # we need to check if they are used at all - GO_PACKAGE: github.com/mysteriumnetwork/node GOFLAGS: "-count=1" - GITHUB_OWNER: "mysteriumnetwork" - GITHUB_REPO: "node" - GITHUB_SNAPSHOT_REPO: "node-builds" - GITHUB_API_TOKEN: "" - BUILD_BRANCH: ${{ github.ref_name }} - BUILD_NUMBER: ${{ github.job_id }} - # BUILD_COMMIT: $CI_COMMIT_SHORT_SHA - # BUILD_BRANCH_SAFE: $CI_COMMIT_REF_SLUG - # BUILD_TAG: $CI_COMMIT_TAG - # GIT_CLONE_PATH: jobs: test-and-build: @@ -34,10 +19,6 @@ jobs: - name: Install protoc run: sudo apt install -y protobuf-compiler - # - name: Prepare Env - # run: | - # go run mage.go -v GenerateEnvFile - - name: Unit tests and linters run: | go run mage.go -v Generate @@ -61,10 +42,3 @@ jobs: - name: E2E NAT test run: go run mage.go -v TestE2ENAT - - # create-release: - # name: Create Release - # if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') - # runs-on: ubuntu-latest - # needs: publish-images - From 44c4396b9bc7e518d09194e72099232da6790033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mantas=20Doma=C5=A1evi=C4=8Dius?= Date: Fri, 16 Feb 2024 11:15:13 +0200 Subject: [PATCH 10/17] Bump NodeUI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mantas Domaševičius --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index cdbab399fb..b214d1c893 100644 --- a/go.mod +++ b/go.mod @@ -37,7 +37,7 @@ require ( github.com/mysteriumnetwork/EventBus v0.0.0-20220415063055-d22cb121672c github.com/mysteriumnetwork/feedback v1.3.2 github.com/mysteriumnetwork/go-ci v0.0.0-20220711082519-1245471bae0d - github.com/mysteriumnetwork/go-dvpn-web/v2 v2.14.3 + github.com/mysteriumnetwork/go-dvpn-web/v2 v2.15.0 github.com/mysteriumnetwork/go-openvpn v0.0.23 github.com/mysteriumnetwork/go-rest v0.3.1 github.com/mysteriumnetwork/go-wondershaper v1.0.1 diff --git a/go.sum b/go.sum index a597225ed1..f58fa31ffe 100644 --- a/go.sum +++ b/go.sum @@ -854,8 +854,8 @@ github.com/mysteriumnetwork/feedback v1.3.2/go.mod h1:g8PD0Gl5UVIFt3N159ohJUmBnG github.com/mysteriumnetwork/go-ci v0.0.0-20200121125840-b99aac3d815c/go.mod h1:GlJmsQDFyRmV9psEs/Mt/humLALu8xmZ7blXQ6Rc9Rs= github.com/mysteriumnetwork/go-ci v0.0.0-20220711082519-1245471bae0d h1:IejX10D2zdFwidh09Gy7L37BHfvc2ckgLrHXadLvzTA= github.com/mysteriumnetwork/go-ci v0.0.0-20220711082519-1245471bae0d/go.mod h1:FdrIqN3Z27igwo8A4aKZcmds7q894iGcdUIPz0+vOXY= -github.com/mysteriumnetwork/go-dvpn-web/v2 v2.14.3 h1:vK7BeQyeN1w3lbCmCYOCGNZ7lMDDL2TvCYyYTogsP7k= -github.com/mysteriumnetwork/go-dvpn-web/v2 v2.14.3/go.mod h1:rFTH4Hfx0pdZUTrJtzy3Yaz0mHTaur7+TezbvWA/8C8= +github.com/mysteriumnetwork/go-dvpn-web/v2 v2.15.0 h1:GT07vEfmbylXKdnpBT6TrRcR9N7D4ddpKsnt8li5ukQ= +github.com/mysteriumnetwork/go-dvpn-web/v2 v2.15.0/go.mod h1:rFTH4Hfx0pdZUTrJtzy3Yaz0mHTaur7+TezbvWA/8C8= github.com/mysteriumnetwork/go-openvpn v0.0.23 h1:6BKoTwU9CpJL/Na9M9a0uaelAaVIo/XZPDpElfzFjxM= github.com/mysteriumnetwork/go-openvpn v0.0.23/go.mod h1:YDjnxC/3sGNecq/f6GM0BGz7nnGPTPIGtQjHaoLf8UE= github.com/mysteriumnetwork/go-rest v0.3.1 h1:zWyeW08ZVm9pWfjBrnq6SYZxoqc8kqzkr3eAbgZqr50= From 0fd8312e20c65dbe8f4cb47a4dff74c5eb9d62c8 Mon Sep 17 00:00:00 2001 From: Timur Zununbekov Date: Thu, 15 Feb 2024 18:44:33 +0600 Subject: [PATCH 11/17] Build platforms matrix --- .github/workflows/build-and-release.yml | 58 ++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index cca49af83e..86398ee1c9 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -1,11 +1,21 @@ name: Test and build -on: [pull_request] +on: + push: + branches: + - master + - ci-migration + tags: + - 'v*' + pull_request: env: GOFLAGS: "-count=1" + RELEASE_BUILD: false + SNAPSHOT_BUILD: false + BUILD_VERSION: ${{ github.sha }} jobs: - test-and-build: + unit-tests: runs-on: ubuntu-latest environment: production @@ -31,6 +41,17 @@ jobs: file: ./coverage.txt token: ${{ secrets.CODECOV_TOKEN }} + e2e-tests: + runs-on: ubuntu-latest + environment: production + + steps: + - uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: '1.21.x' + - name: Login to Docker Hub uses: docker/login-action@v3 with: @@ -42,3 +63,36 @@ jobs: - name: E2E NAT test run: go run mage.go -v TestE2ENAT + + build: + if: github.event_name != 'pull_request' + runs-on: ubuntu-latest + environment: production + needs: e2e-tests + + strategy: + max-parallel: 3 + matrix: + platform: + - PackageLinuxAmd64 + - PackageLinuxArm + - PackageLinuxDebianAmd64 + - PackageLinuxDebianArm64 + - PackageLinuxDebianArm + - PackageLinuxRaspberryImage + - PackageMacOSAmd64 + - PackageMacOSArm64 + - PackageWindowsAmd64 + - PackageAndroid + - PackageAndroidProvider + - PackageDockerSwaggerRedoc + + steps: + - uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: '1.21.x' + + - name: Build package + run: go run mage.go -v ${{ matrix.platform }} From 4f56bd7a3d82910a6f31aaad92d690aeeb4f8e62 Mon Sep 17 00:00:00 2001 From: Timur Zununbekov Date: Fri, 16 Feb 2024 13:11:44 +0600 Subject: [PATCH 12/17] Workflow triggers rework --- .github/workflows/build-and-release.yml | 98 -------------------- .github/workflows/e2e.yml | 30 ++++++ .github/workflows/release.yml | 53 +++++++++++ .github/workflows/unit-tests-and-linters.yml | 39 ++++++++ 4 files changed, 122 insertions(+), 98 deletions(-) delete mode 100644 .github/workflows/build-and-release.yml create mode 100644 .github/workflows/e2e.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/unit-tests-and-linters.yml diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml deleted file mode 100644 index 86398ee1c9..0000000000 --- a/.github/workflows/build-and-release.yml +++ /dev/null @@ -1,98 +0,0 @@ -name: Test and build -on: - push: - branches: - - master - - ci-migration - tags: - - 'v*' - pull_request: - -env: - GOFLAGS: "-count=1" - RELEASE_BUILD: false - SNAPSHOT_BUILD: false - BUILD_VERSION: ${{ github.sha }} - -jobs: - unit-tests: - runs-on: ubuntu-latest - environment: production - - steps: - - uses: actions/checkout@v4 - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version: '1.21.x' - - - name: Install protoc - run: sudo apt install -y protobuf-compiler - - - name: Unit tests and linters - run: | - go run mage.go -v Generate - go run mage.go -v Check - go run mage.go -v TestWithCoverage - - - name: Upload codecov report - uses: codecov/codecov-action@v4 - with: - file: ./coverage.txt - token: ${{ secrets.CODECOV_TOKEN }} - - e2e-tests: - runs-on: ubuntu-latest - environment: production - - steps: - - uses: actions/checkout@v4 - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version: '1.21.x' - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: E2E basic test - run: go run mage.go -v TestE2EBasic - - - name: E2E NAT test - run: go run mage.go -v TestE2ENAT - - build: - if: github.event_name != 'pull_request' - runs-on: ubuntu-latest - environment: production - needs: e2e-tests - - strategy: - max-parallel: 3 - matrix: - platform: - - PackageLinuxAmd64 - - PackageLinuxArm - - PackageLinuxDebianAmd64 - - PackageLinuxDebianArm64 - - PackageLinuxDebianArm - - PackageLinuxRaspberryImage - - PackageMacOSAmd64 - - PackageMacOSArm64 - - PackageWindowsAmd64 - - PackageAndroid - - PackageAndroidProvider - - PackageDockerSwaggerRedoc - - steps: - - uses: actions/checkout@v4 - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version: '1.21.x' - - - name: Build package - run: go run mage.go -v ${{ matrix.platform }} diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 0000000000..a4a50de3e6 --- /dev/null +++ b/.github/workflows/e2e.yml @@ -0,0 +1,30 @@ +name: E2E tests +on: + workflow_run: + workflows: [Unit tests and linters] + types: [completed] + +jobs: + e2e-tests: + if: ${{ github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-latest + environment: production + + steps: + - uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: '1.21.x' + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: E2E basic test + run: go run mage.go -v TestE2EBasic + + - name: E2E NAT test + run: go run mage.go -v TestE2ENAT diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..724ed968fb --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,53 @@ +name: Build and Release +on: + workflow_run: + workflows: [E2E tests] + types: [completed] + branches: [master, ci-migration] + push: + tags: + - "v*" + +env: + RELEASE_BUILD: false + SNAPSHOT_BUILD: false + BUILD_VERSION: ${{ github.sha }} + +jobs: + build-packages: + if: | + ${{ github.event.workflow_run.conclusion == 'success' }} || + ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }} + runs-on: ubuntu-latest + environment: production + + strategy: + max-parallel: 3 + matrix: + platform: + - PackageLinuxAmd64 + - PackageLinuxArm + - PackageLinuxDebianAmd64 + - PackageLinuxDebianArm64 + - PackageLinuxDebianArm + - PackageLinuxRaspberryImage + - PackageMacOSAmd64 + - PackageMacOSArm64 + - PackageWindowsAmd64 + - PackageAndroid + - PackageAndroidProvider + - PackageDockerSwaggerRedoc + + steps: + - uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: '1.21.x' + - name: Setup FPM + run: | + sudo apt-get install ruby-dev build-essential + sudo gem i fpm -f + + - name: Build package + run: go run mage.go -v ${{ matrix.platform }} diff --git a/.github/workflows/unit-tests-and-linters.yml b/.github/workflows/unit-tests-and-linters.yml new file mode 100644 index 0000000000..e3c7e451ef --- /dev/null +++ b/.github/workflows/unit-tests-and-linters.yml @@ -0,0 +1,39 @@ +name: Unit tests and linters +on: + pull_request: + # for debug purposes only + push: + branches: [ci-migration] + +env: + GOFLAGS: "-count=1" + +jobs: + unit-tests: + runs-on: ubuntu-latest + environment: production + + steps: + - uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: '1.21.x' + + - name: Install protoc + run: sudo apt install -y protobuf-compiler + + - name: Unit tests and linters + run: | + go run mage.go -v Generate + go run mage.go -v Check + go run mage.go -v TestWithCoverage + + - name: Upload codecov report + uses: codecov/codecov-action@v4 + with: + file: ./coverage.txt + token: ${{ secrets.CODECOV_TOKEN }} + + + From 4ea3399f063044be9ef57739a3b0fa503f48e595 Mon Sep 17 00:00:00 2001 From: Timur Zununbekov Date: Fri, 16 Feb 2024 13:17:48 +0600 Subject: [PATCH 13/17] Debug package build step --- .github/workflows/e2e.yml | 4 ++++ .github/workflows/release.yml | 11 ++++++++--- .github/workflows/unit-tests-and-linters.yml | 6 +++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a4a50de3e6..77f8403f7d 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -3,6 +3,10 @@ on: workflow_run: workflows: [Unit tests and linters] types: [completed] + # # for debug purposes only + # push: + # branches: [ci-migration] + jobs: e2e-tests: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 724ed968fb..c393b54d5e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,8 @@ on: push: tags: - "v*" + # for debug purposes only + branches: [ci-migration] env: RELEASE_BUILD: false @@ -15,9 +17,9 @@ env: jobs: build-packages: - if: | - ${{ github.event.workflow_run.conclusion == 'success' }} || - ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }} + # if: | + # ${{ github.event.workflow_run.conclusion == 'success' }} || + # ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }} runs-on: ubuntu-latest environment: production @@ -50,4 +52,7 @@ jobs: sudo gem i fpm -f - name: Build package + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} run: go run mage.go -v ${{ matrix.platform }} diff --git a/.github/workflows/unit-tests-and-linters.yml b/.github/workflows/unit-tests-and-linters.yml index e3c7e451ef..7a3bbfcf3e 100644 --- a/.github/workflows/unit-tests-and-linters.yml +++ b/.github/workflows/unit-tests-and-linters.yml @@ -1,9 +1,9 @@ name: Unit tests and linters on: pull_request: - # for debug purposes only - push: - branches: [ci-migration] + # # for debug purposes only + # push: + # branches: [ci-migration] env: GOFLAGS: "-count=1" From 1de86dc1f155284b23a549c5713e7f2177b133d9 Mon Sep 17 00:00:00 2001 From: Timur Zununbekov Date: Fri, 16 Feb 2024 16:22:55 +0600 Subject: [PATCH 14/17] Use original Env setup script --- .github/workflows/release.yml | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c393b54d5e..032ff81c63 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,10 +10,17 @@ on: # for debug purposes only branches: [ci-migration] +# env: + # RELEASE_BUILD: ${{ contains(github.ref, 'refs/tags/v') && 'true' || 'false' }} + # SNAPSHOT_BUILD: ${{ github.ref == 'refs/heads/master' && 'true' || 'false' }} + # RC_BUILD: ${{ github.ref_type == 'tag' && endsWith(github.ref, '-rc') && 'true' || 'false' }} + # BUILD_VERSION: + env: - RELEASE_BUILD: false - SNAPSHOT_BUILD: false - BUILD_VERSION: ${{ github.sha }} + GITHUB_OWNER: mysteriumnetwork + GITHUB_REPO: node + GITHUB_SNAPSHOT_REPO: node-builds + GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: build-packages: @@ -24,15 +31,15 @@ jobs: environment: production strategy: - max-parallel: 3 + max-parallel: 4 matrix: platform: + - PackageLinuxRaspberryImage - PackageLinuxAmd64 - PackageLinuxArm - PackageLinuxDebianAmd64 - PackageLinuxDebianArm64 - PackageLinuxDebianArm - - PackageLinuxRaspberryImage - PackageMacOSAmd64 - PackageMacOSArm64 - PackageWindowsAmd64 @@ -46,6 +53,16 @@ jobs: uses: actions/setup-go@v4 with: go-version: '1.21.x' + - name: Generate Env + run: go run mage.go -v GenerateEnvFile + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Setup FPM run: | sudo apt-get install ruby-dev build-essential @@ -55,4 +72,6 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - run: go run mage.go -v ${{ matrix.platform }} + run: | + source build/env.sh + go run mage.go -v ${{ matrix.platform }} From d40c25580e5f7431e324af565deb618be7aaabf9 Mon Sep 17 00:00:00 2001 From: Timur Zununbekov Date: Fri, 16 Feb 2024 17:50:28 +0600 Subject: [PATCH 15/17] Build docs separately --- .github/workflows/e2e.yml | 14 ++-- .github/workflows/release.yml | 68 +++++++++++++------- .github/workflows/unit-tests-and-linters.yml | 4 +- 3 files changed, 55 insertions(+), 31 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 77f8403f7d..c5531d91a1 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,16 +1,20 @@ name: E2E tests +# Run E2E tests after Unit tests (currently, they run on PRs) +# and on "v*" tags push events on: workflow_run: workflows: [Unit tests and linters] types: [completed] - # # for debug purposes only - # push: - # branches: [ci-migration] - + push: + tags: + - "v*" jobs: e2e-tests: - if: ${{ github.event.workflow_run.conclusion == 'success' }} + # Parent workflow (unit tests) must succeed or it must be a tag push + if: | + ${{ github.event.workflow_run.conclusion == 'success' }} || + ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }} runs-on: ubuntu-latest environment: production diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 032ff81c63..476c388bc7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,21 +1,13 @@ name: Build and Release +# Start build and release process only on E2E completion on master branch +# Big chunk of the release process logic is in the mage build targets on: workflow_run: workflows: [E2E tests] types: [completed] - branches: [master, ci-migration] - push: - tags: - - "v*" - # for debug purposes only - branches: [ci-migration] - -# env: - # RELEASE_BUILD: ${{ contains(github.ref, 'refs/tags/v') && 'true' || 'false' }} - # SNAPSHOT_BUILD: ${{ github.ref == 'refs/heads/master' && 'true' || 'false' }} - # RC_BUILD: ${{ github.ref_type == 'tag' && endsWith(github.ref, '-rc') && 'true' || 'false' }} - # BUILD_VERSION: + branches: [master] +# Mage's `GenerateEnvFile` talks to GH API to setup tags, versions, etc. env: GITHUB_OWNER: mysteriumnetwork GITHUB_REPO: node @@ -24,9 +16,9 @@ env: jobs: build-packages: - # if: | - # ${{ github.event.workflow_run.conclusion == 'success' }} || - # ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }} + if: | + ${{ github.event.workflow_run.conclusion == 'success' }} || + ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }} runs-on: ubuntu-latest environment: production @@ -45,7 +37,39 @@ jobs: - PackageWindowsAmd64 - PackageAndroid - PackageAndroidProvider - - PackageDockerSwaggerRedoc + + steps: + - uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: '1.21.x' + - name: Generate Env + run: go run mage.go -v GenerateEnvFile + + - name: Setup FPM + run: | + sudo apt-get install ruby-dev build-essential + sudo gem i fpm -f + + - name: Build package + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + run: | + source build/env.sh + # Following line ensures that s3 bucket name won't overlap with the old CI's target + # Should be removed when the old CI is disabled + export BUILD_NUMBER=$BUILD_NUMBER"-ghactions" + go run mage.go -v ${{ matrix.platform }} + + build-swagger: + if: | + ${{ github.event.workflow_run.conclusion == 'success' }} || + ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }} + runs-on: ubuntu-latest + environment: production + needs: [build-packages] steps: - uses: actions/checkout@v4 @@ -63,15 +87,13 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Setup FPM - run: | - sudo apt-get install ruby-dev build-essential - sudo gem i fpm -f - - - name: Build package + - name: Build docker env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} run: | source build/env.sh - go run mage.go -v ${{ matrix.platform }} + # Following line ensures that s3 bucket name won't overlap with the old CI's target + # Should be removed when the old CI is disabled + export BUILD_NUMBER=$BUILD_NUMBER"-ghactions" + go run mage.go -v PackageDockerSwaggerRedoc diff --git a/.github/workflows/unit-tests-and-linters.yml b/.github/workflows/unit-tests-and-linters.yml index 7a3bbfcf3e..3b7899733c 100644 --- a/.github/workflows/unit-tests-and-linters.yml +++ b/.github/workflows/unit-tests-and-linters.yml @@ -1,9 +1,7 @@ name: Unit tests and linters +# Run unit tests on all pull requests on: pull_request: - # # for debug purposes only - # push: - # branches: [ci-migration] env: GOFLAGS: "-count=1" From db11f141dd7e074fa34316543baa22cb8a5af0ef Mon Sep 17 00:00:00 2001 From: Timur Zununbekov Date: Mon, 19 Feb 2024 12:02:32 +0600 Subject: [PATCH 16/17] Run everything on all PRs --- .../workflows/{release.yml => build-packages.yml} | 13 +++++-------- .github/workflows/e2e.yml | 9 ++------- 2 files changed, 7 insertions(+), 15 deletions(-) rename .github/workflows/{release.yml => build-packages.yml} (84%) diff --git a/.github/workflows/release.yml b/.github/workflows/build-packages.yml similarity index 84% rename from .github/workflows/release.yml rename to .github/workflows/build-packages.yml index 476c388bc7..ccded3edc6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/build-packages.yml @@ -1,11 +1,10 @@ -name: Build and Release -# Start build and release process only on E2E completion on master branch -# Big chunk of the release process logic is in the mage build targets +name: Build packages +# Start build process only on E2E completion +# Big chunk of the build process logic is in the mage build targets on: workflow_run: workflows: [E2E tests] types: [completed] - branches: [master] # Mage's `GenerateEnvFile` talks to GH API to setup tags, versions, etc. env: @@ -17,8 +16,7 @@ env: jobs: build-packages: if: | - ${{ github.event.workflow_run.conclusion == 'success' }} || - ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }} + ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest environment: production @@ -65,8 +63,7 @@ jobs: build-swagger: if: | - ${{ github.event.workflow_run.conclusion == 'success' }} || - ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }} + ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest environment: production needs: [build-packages] diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index c5531d91a1..ab79e58419 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,20 +1,15 @@ name: E2E tests # Run E2E tests after Unit tests (currently, they run on PRs) -# and on "v*" tags push events on: workflow_run: workflows: [Unit tests and linters] types: [completed] - push: - tags: - - "v*" jobs: e2e-tests: - # Parent workflow (unit tests) must succeed or it must be a tag push + # Parent workflow (unit tests) must succeed if: | - ${{ github.event.workflow_run.conclusion == 'success' }} || - ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }} + ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest environment: production From 4989df1ff30059198d773fb372de6e57e85fb2ba Mon Sep 17 00:00:00 2001 From: Timur Zununbekov Date: Mon, 19 Feb 2024 13:25:18 +0600 Subject: [PATCH 17/17] Update workflows triggering and dependencies --- .github/workflows/build-packages.yml | 14 ++--- .github/workflows/e2e.yml | 33 ----------- .github/workflows/tests-and-linters.yml | 60 ++++++++++++++++++++ .github/workflows/unit-tests-and-linters.yml | 37 ------------ 4 files changed, 64 insertions(+), 80 deletions(-) delete mode 100644 .github/workflows/e2e.yml create mode 100644 .github/workflows/tests-and-linters.yml delete mode 100644 .github/workflows/unit-tests-and-linters.yml diff --git a/.github/workflows/build-packages.yml b/.github/workflows/build-packages.yml index ccded3edc6..5d98b4df33 100644 --- a/.github/workflows/build-packages.yml +++ b/.github/workflows/build-packages.yml @@ -1,10 +1,10 @@ name: Build packages -# Start build process only on E2E completion # Big chunk of the build process logic is in the mage build targets on: - workflow_run: - workflows: [E2E tests] - types: [completed] + workflow_call: + push: + branches: [master] + tags: # Mage's `GenerateEnvFile` talks to GH API to setup tags, versions, etc. env: @@ -15,10 +15,7 @@ env: jobs: build-packages: - if: | - ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest - environment: production strategy: max-parallel: 4 @@ -62,10 +59,7 @@ jobs: go run mage.go -v ${{ matrix.platform }} build-swagger: - if: | - ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest - environment: production needs: [build-packages] steps: diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml deleted file mode 100644 index ab79e58419..0000000000 --- a/.github/workflows/e2e.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: E2E tests -# Run E2E tests after Unit tests (currently, they run on PRs) -on: - workflow_run: - workflows: [Unit tests and linters] - types: [completed] - -jobs: - e2e-tests: - # Parent workflow (unit tests) must succeed - if: | - ${{ github.event.workflow_run.conclusion == 'success' }} - runs-on: ubuntu-latest - environment: production - - steps: - - uses: actions/checkout@v4 - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version: '1.21.x' - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: E2E basic test - run: go run mage.go -v TestE2EBasic - - - name: E2E NAT test - run: go run mage.go -v TestE2ENAT diff --git a/.github/workflows/tests-and-linters.yml b/.github/workflows/tests-and-linters.yml new file mode 100644 index 0000000000..b3ff7ad3a7 --- /dev/null +++ b/.github/workflows/tests-and-linters.yml @@ -0,0 +1,60 @@ +name: Tests +on: + pull_request: + +env: + GOFLAGS: "-count=1" + +jobs: + unit-tests: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: '1.21.x' + + - name: Install protoc + run: sudo apt install -y protobuf-compiler + + - name: Unit tests and linters + run: | + go run mage.go -v Generate + go run mage.go -v Check + go run mage.go -v TestWithCoverage + + - name: Upload codecov report + uses: codecov/codecov-action@v4 + with: + file: ./coverage.txt + token: ${{ secrets.CODECOV_TOKEN }} + + e2e-tests: + runs-on: ubuntu-latest + needs: unit-tests + + steps: + - uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: '1.21.x' + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: E2E basic test + run: go run mage.go -v TestE2EBasic + + - name: E2E NAT test + run: go run mage.go -v TestE2ENAT + + verify-build: + needs: [unit-tests, e2e-tests] + uses: ./.github/workflows/build-packages.yml + secrets: inherit diff --git a/.github/workflows/unit-tests-and-linters.yml b/.github/workflows/unit-tests-and-linters.yml deleted file mode 100644 index 3b7899733c..0000000000 --- a/.github/workflows/unit-tests-and-linters.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Unit tests and linters -# Run unit tests on all pull requests -on: - pull_request: - -env: - GOFLAGS: "-count=1" - -jobs: - unit-tests: - runs-on: ubuntu-latest - environment: production - - steps: - - uses: actions/checkout@v4 - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version: '1.21.x' - - - name: Install protoc - run: sudo apt install -y protobuf-compiler - - - name: Unit tests and linters - run: | - go run mage.go -v Generate - go run mage.go -v Check - go run mage.go -v TestWithCoverage - - - name: Upload codecov report - uses: codecov/codecov-action@v4 - with: - file: ./coverage.txt - token: ${{ secrets.CODECOV_TOKEN }} - - -