Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

Commit

Permalink
ref: update check-source-code action
Browse files Browse the repository at this point in the history
  • Loading branch information
adriantpaez committed Jul 31, 2023
1 parent 9891127 commit b96bcd0
Showing 1 changed file with 3 additions and 91 deletions.
94 changes: 3 additions & 91 deletions .github/workflows/check-source-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [main, develop]

jobs:
code-format:
check-code:
name: Code format
strategy:
matrix:
Expand All @@ -16,28 +16,14 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout
uses: actions/checkout@v3

- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

- name: Install mockgen
run: make install-mockgen

- name: Generate mocks
run: make generate

- name: Instal gofumpt
run: make install-gofumpt

- name: Install dependencies
run: make install-deps
- name: Check code format
run: |
if [[ ! -z $(make format) ]];
Expand All @@ -46,41 +32,10 @@ jobs:
exit 1
fi
shell: bash

- name: Install staticcheck
run: make install-staticcheck

- name: Run staticcheck
run: make staticcheck
build:
name: Build
needs: code-format
strategy:
matrix:
go: ["1.20"]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}

steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout
uses: actions/checkout@v3

- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

- name: Install mockgen
run: make install-mockgen

- name: Generate mocks
run: make generate

- name: Check go mod status
run: |
make gomod_tidy
Expand All @@ -92,52 +47,9 @@ jobs:
exit 1
fi
shell: bash

- name: Check build
run: make build
test:
name: Run tests
needs: build
strategy:
matrix:
go: ["1.20"]
os: [ubuntu-latest]
codecov: [false]
runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

- name: Install deps
run: make install-deps

- name: Generate mocks
run: make generate

- name: Unit tests
if: matrix.codecov == false
run: make unit-test

- name: Codecov tests
if: matrix.codecov == true
run: make codecov-test

- name: Upload coverage to Codecov
if: matrix.codecov == true
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
files: ./coverage.out
flags: unittests
name: codecov-umbrella
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: E2E tests
run: make e2e-test

0 comments on commit b96bcd0

Please sign in to comment.