Go Test #220
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: Go Test | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * 5' | |
push: | |
branches: [main, develop] | |
pull_request: | |
branches: [main, develop] | |
jobs: | |
macos: | |
strategy: | |
matrix: | |
os: [macos-latest, macos-12] | |
go: ['1.17', '1.18', '1.19'] | |
runs-on: ${{ matrix.os }} | |
name: macOS Go${{ matrix.go }} on ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Install tesseract | |
run: brew install tesseract | |
- name: Install pkg | |
run: go get -u -v -t ./... | |
- name: Test | |
run: go test -v -cover ./... | |
coverage: | |
runs-on: ubuntu-latest | |
name: Ubuntu for Coverage | |
needs: macos | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.18' | |
- name: Install packages | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
libtesseract-dev \ | |
libleptonica-dev \ | |
tesseract-ocr-eng | |
- name: Coverage Test | |
run: go test -v -cover -race -coverprofile=coverage -covermode=atomic | |
- name: Upload coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./coverage | |
verbose: true |