Skip to content

GoAnime Coverage

GoAnime Coverage #121

Workflow file for this run

name: GoAnime Coverage
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]
schedule:
- cron: '0 0 * * *'
jobs:
coverage:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macOS-latest ]
go-version: [ '1.22.0' ]
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Check out code
uses: actions/checkout@v3
- name: Ensure go.sum exists
run: go mod tidy
- name: Cache Go modules
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install -y mpv yt-dlp
- name: Install dependencies (Windows)
if: runner.os == 'Windows'
run: |
choco install mpv
choco install yt-dlp
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install mpv yt-dlp
- name: Get dependencies
run: go get -v -t -d ./...
- name: Run tests
run: go test -v ./...
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}