Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions trigger conditions update #5975

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading