Update stock.yml #84
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
on: | |
push: | |
branches: | |
- '*' | |
- 'feature/*' | |
pull_request: | |
branches: | |
- main | |
# reddit access for golang tests | |
# since I am an single dev | |
# what I care about is regression | |
# making sure my code still works on the reddit api | |
env: | |
REDDIT_CLIENT_ID: ${{ secrets.REDDIT_CLIENT_ID }} | |
REDDIT_CLIENT_SECRET: ${{ secrets.REDDIT_CLIENT_SECRET }} | |
REDDIT_PASSWORD: ${{ secrets.REDDIT_PASSWORD }} | |
REDDIT_USERNAME: ${{ secrets.REDDIT_USERNAME }} | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_CODE_WEBHOOK}} | |
name: run tests | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.19.1 | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Run linters | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: v1.29 | |
test: | |
strategy: | |
matrix: | |
go-version: [1.19.1] | |
platform: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Install Go | |
if: success() | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Run tests | |
run: go test ./... -v -covermode=count | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Go | |
if: success() | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.19.x | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Calc coverage | |
run: | | |
go test ./... -v -covermode=count -coverprofile=coverage.out | |
- name: Convert coverage.out to coverage.lcov | |
uses: jandelgado/[email protected] | |
- name: Coveralls | |
uses: codecov/codecov-action@v1 | |
with: | |
file: coverage.lcov # optional | |
name: finreddit # optional | |
fail_ci_if_error: true # optional (default = false) | |
verbose: true # optional (default = false) |