Skip to content

Commit

Permalink
Merge pull request #5975 from mysteriumnetwork/ci-migration
Browse files Browse the repository at this point in the history
GitHub Actions trigger conditions update
  • Loading branch information
tzununbekov authored Feb 19, 2024
2 parents c29b292 + 4989df1 commit b1b6e97
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 80 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/e2e.yml

This file was deleted.

60 changes: 60 additions & 0 deletions .github/workflows/tests-and-linters.yml
Original file line number Diff line number Diff line change
@@ -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
37 changes: 0 additions & 37 deletions .github/workflows/unit-tests-and-linters.yml

This file was deleted.

0 comments on commit b1b6e97

Please sign in to comment.