U: energy cli #57
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
# This workflow will build a golang project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
name: build-test | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, windows-2019] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.20' | |
- name: Linux Install Dependencies(OpenGL) | |
if: ${{ matrix.os == 'ubuntu-22.04' }} | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y mesa-utils mesa-common-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libgl1-mesa-dev libxxf86vm-dev libglfw3-dev | |
- name: Windows ENABLED CGO | |
if: matrix.os == 'windows-2019' | |
run: | | |
set CGO_ENABLED=1 | |
go env | |
- name: Build Energy CLI | |
run: | | |
cd ./cmd/energy | |
go install | |
energy | |
energy cli -v | |
- name: Test | |
run: | | |
go mod tidy | |
go test -v -coverprofile="cover.out" -covermode=atomic ./... | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: "cover.out" | |
flags: unittests | |
verbose: true |