Go-based Feed Fetcher Implementation #2
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: FeedFetcher Tests | |
| on: | |
| pull_request: | |
| paths: | |
| - 'feedfetcher/**' | |
| - '.github/workflows/feedfetcher-tests.yml' | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'feedfetcher/**' | |
| jobs: | |
| test: | |
| name: 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.21' | |
| - name: Download dependencies | |
| working-directory: ./feedfetcher | |
| run: go mod download | |
| - name: Run tests | |
| working-directory: ./feedfetcher | |
| run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./... | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| file: ./feedfetcher/coverage.txt | |
| flags: feedfetcher | |
| build: | |
| name: 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.21' | |
| - name: Build binary | |
| working-directory: ./feedfetcher | |
| run: make build | |
| - name: Verify binary | |
| working-directory: ./feedfetcher | |
| run: | | |
| ./feedfetcher --help || true | |
| file feedfetcher | |
| lint: | |
| name: 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.21' | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@v3 | |
| with: | |
| version: latest | |
| working-directory: ./feedfetcher |