feat: add '-version' #37
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: CI | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
build-test: | |
name: Build & Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: 'stable' | |
cache: false | |
- uses: actions/checkout@v4 | |
- name: Build | |
run: | | |
go build -v ./... | |
- name: Unit Tests | |
run: | | |
go test -coverprofile=c.out -v ./... | |
- name: Unit Tests Code Coverage Report | |
run: | | |
go tool cover -func=c.out | |
go tool cover -html=c.out -o coverage.html | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: coverage | |
path: coverage.html | |
- name: Build Integration Tests | |
run: | | |
mkdir -p build | |
go build -cover -o build ./cmd/* | |
- name: Intgration Tests Code Coverage | |
run: | | |
cd build | |
mkdir -p coverdata | |
export GOCOVERDIR=./coverdata | |
./mediadump -logtostderr -i ../assets/sintel_trailer-720p-firstgopfmp4.mp4 -o /dev/null | |
./mp42avc -logtostderr -i ../assets/sintel_trailer-720p-firstgopfmp4.mp4 -o mp4.h264 | |
./mediadump -logtostderr -i mp4.h264 -o /dev/null | |
./mediadump -logtostderr -i ../assets/sintel_trailer-720p-firstgopfmp4.flv -o /dev/null | |
# ./flv2avc -logtostderr -i ../assets/sintel_trailer-720p-firstgopfmp4.flv -o flv.h264 | |
# ./mediadump -logtostderr -i flv.h264 -o /dev/null | |
go tool covdata percent -i ./coverdata | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: 'stable' | |
cache: false | |
- uses: actions/checkout@v4 | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
args: -v --print-resources-usage --enable gofmt | |