Skip to content

Commit

Permalink
Workflow triggers rework
Browse files Browse the repository at this point in the history
  • Loading branch information
tzununbekov committed Feb 16, 2024
1 parent 846d69e commit f15fdbd
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 98 deletions.
98 changes: 0 additions & 98 deletions .github/workflows/build-and-release.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -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
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
39 changes: 39 additions & 0 deletions .github/workflows/unit-tests-and-linters.yml
Original file line number Diff line number Diff line change
@@ -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 }}



0 comments on commit f15fdbd

Please sign in to comment.