From 8e111bc0226aec7eb8bc9cf9f46dd6f86f750be0 Mon Sep 17 00:00:00 2001 From: Valdas Petrulis Date: Tue, 7 May 2024 10:20:56 +0300 Subject: [PATCH] Configure CI workflow with Github actions --- .github/workflows/quality.yml | 53 +++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/quality.yml diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml new file mode 100644 index 0000000..5a125e7 --- /dev/null +++ b/.github/workflows/quality.yml @@ -0,0 +1,53 @@ +# This is a basic workflow to help you get started with Actions + +name: "Check code quality" + +# Controls when the workflow will run +on: + # Push events to matching v*, i.e. v1.0, v20.15.10 + push: + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + + unit-test: + name: "Unit tests" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: 1.18.x + - run: go run ci/mage.go -v Test + + check: + name: "Quality checks" + runs-on: ubuntu-latest + env: + GOPATH: ${{ github.workspace }} + defaults: + run: + working-directory: ${{ github.workspace }}/src/github.com/${{ github.repository }} + steps: + - uses: actions/checkout@v3 + with: + path: ${{ github.workspace }}/src/github.com/${{ github.repository }} + - uses: actions/setup-go@v3 + with: + go-version: 1.18.x + - run: go run ci/mage.go -v CheckCopyright + - run: go run ci/mage.go -v CheckGoImports + - run: go run ci/mage.go -v CheckGoLint + - run: go run ci/mage.go -v CheckGoVet + + e2e-test: + name: "End-to-end tests" + needs: [ unit-test, check ] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: 1.18.x + - run: go run ci/mage.go -v TestE2e