FIX: URL for golangci-lint #3
This file contains hidden or 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
| # This workflow will build a golang project | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
| name: Go | |
| on: | |
| create: | |
| branches: [ "master" ] | |
| workflow_dispatch: | |
| release: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.23' | |
| - name: Prepare tools | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc libgl1-mesa-dev xorg-dev xz-utils gcc-mingw-w64-x86-64 unzip apksigner | |
| go install fyne.io/fyne/v2/cmd/fyne@latest | |
| wget https://dl.google.com/android/repository/android-ndk-r25c-linux.zip | |
| unzip android-ndk-r25c-linux.zip | |
| echo "Getting secure files..." | |
| curl --silent "https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer" | bash | |
| - name: Compile the code | |
| run: | | |
| echo building ${{ github.ref_name }} | |
| ./build.sh ${{ github.ref_name }} | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-artifacts | |
| path: | | |
| EZComm_cmd | |
| EZComm_cmd.exe | |
| EZComm | |
| EZComm_debug | |
| EZComm.exe | |
| EZComm_debug.exe | |
| EZComm.apk | |
| EZComm_debug.apk | |
| unit-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.23' | |
| - name: Prepare tools | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc libgl1-mesa-dev xorg-dev xz-utils | |
| - name: Run unit tests | |
| run: go test -v -cover ./... | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.23' | |
| - name: Install gocyclo | |
| run: go install github.com/fzipp/gocyclo/cmd/gocyclo@latest | |
| - name: Cyclone code | |
| run: gocyclo -over 30 . | |
| - name: Install golangci-lint | |
| run: | | |
| GOLANGCI_LINT_VERSION=1.61.0 | |
| wget | |
| https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_LINT_VERSION}/golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64.tar.gz | |
| tar -xzf golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64.tar.gz | |
| sudo mv golangci-lint-*/golangci-lint /usr/local/bin/ | |
| - name: Lint code | |
| run: golangci-lint run --timeout 10m --issues-exit-code 1 --print-issued-lines=false --out-format code-climate:gl-code-quality-report.json,line-number | |
| - name: Upload lint report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lint-report | |
| path: gl-code-quality-report.json |