add github stuff #1
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
| name: Test Go | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.ARDUINOBOT_TOKEN }} | |
| GITHUB_USERNAME: ArduinoBot | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| # In the same branch only 1 workflow per time can run. In case we're not in the | |
| # main branch we cancel previous running workflow | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| permissions: | |
| contents: read | |
| # Used by the buf to create a comment with a brief summary of failing tets | |
| pull-requests: write | |
| jobs: | |
| run-checks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Configure credential to download private go modules | |
| run: | | |
| echo "machine github.com login $GITHUB_USERNAME password $GITHUB_TOKEN" > ~/.netrc | |
| - uses: dprint/[email protected] | |
| with: | |
| dprint-version: 0.48.0 | |
| - uses: golangci/golangci-lint-action@v8 | |
| with: | |
| version: v2.4.0 | |
| args: --timeout 300s | |
| - name: Check go mod | |
| run: | | |
| go mod tidy | |
| git diff --color --exit-code | |