GoAnime Coverage #140
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
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 }} |