Consolidate reply handling into tweet repository #570
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: Tests & Static Analysis | |
| env: | |
| GO_VERSION: "1.26.0" | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| lint: | |
| name: Lint & Vulnerabilities | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| cache: true | |
| - name: Verify dependencies | |
| run: go mod verify | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v8 | |
| with: | |
| version: latest | |
| args: --timeout=5m | |
| - name: Run golvulncheck | |
| uses: golang/govulncheck-action@v1 | |
| continue-on-error: true | |
| test: | |
| name: Test | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest] | |
| fail-fast: false | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| cache: true | |
| - name: Run tests | |
| if: ${{ matrix.os != 'ubuntu-latest' }} | |
| run: go test -race ./... | |
| - name: Run tests (with coverage) | |
| if: ${{ matrix.os == 'ubuntu-latest' }} # collect & upload coverage only from one of the runners | |
| run: go test -race -coverprofile=coverage.out ./... | |
| - name: Check code coverage | |
| if: ${{ matrix.os == 'ubuntu-latest' }} | |
| run: | | |
| go tool cover -func=coverage.out -o=coverage.txt | |
| go tool cover -html=coverage.out -o=coverage.html | |
| - name: Upload coverage artifacts | |
| if: ${{ matrix.os == 'ubuntu-latest' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: | | |
| coverage.out | |
| coverage.html | |
| coverage.txt | |
| - name: Upload coverage data to Codecov | |
| if: ${{ matrix.os == 'ubuntu-latest' }} | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage.out | |
| name: codecov-umbrella | |
| slug: Warp-net/warpnet | |
| fail_ci_if_error: true | |
| - name: Calculate coverage | |
| if: ${{ github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest' }} | |
| id: coverage | |
| run: | | |
| COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print substr($3, 1, length($3)-1)}') | |
| echo "coverage=$COVERAGE" >> $GITHUB_OUTPUT |