This repository has been archived by the owner on Dec 12, 2023. It is now read-only.
add archive message #678
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check source code | |
on: | |
push: | |
branches: [main, develop] | |
pull_request: | |
branches: [main, develop] | |
jobs: | |
check-code: | |
name: Code format | |
strategy: | |
matrix: | |
go: ["1.21"] | |
os: [ubuntu-latest] | |
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 dependencies | |
run: make install-deps | |
- name: Check code format | |
run: | | |
if [[ ! -z $(make format) ]]; | |
then | |
echo "Code is not formatted. Please run 'make format' and commit changes" | |
exit 1 | |
fi | |
shell: bash | |
- name: Generate mocks | |
run: make generate | |
- name: Run staticcheck | |
run: make staticcheck | |
- name: Check go mod status | |
run: | | |
make gomod_tidy | |
if [[ ! -z $(git status -s | grep 'go.mod') ]] || [[ ! -z $(git status -s | grep 'go.sum') ]]; | |
then | |
echo "Changes on go.mod or go.sum files - state is not clean:" | |
git status -s | |
git diff "$GITHUB_SHA" | |
exit 1 | |
fi | |
shell: bash | |
- name: Check build | |
run: make build | |
- name: Unit tests | |
run: make unit-test | |
# These tests were only running for install and monitoring so commenting for now | |
# - name: E2E tests | |
# run: make e2e-test |