refactor!: add context to the root command #30
Workflow file for this run
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: Tests | |
# Tests / Code Coverage workflow runs unit tests and uploads a code coverage report. | |
# This workflow is run on pushes to master & every Pull Requests where a .go, .mod, .sum have been changed. | |
on: | |
pull_request: | |
push: | |
branches: | |
- cosmos/* | |
jobs: | |
Cleanup-runs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: rokroskar/workflow-run-cleanup-action@master | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
if: "!startsWith(github.ref, 'refs/tags/') && !startsWith(github.ref, 'refs/tags/cosmos')" | |
Unit-tests: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v3 | |
- name: Setup Go 🧰 | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.21" | |
- name: Compute diff 📜 | |
uses: technote-space/get-diff-action@v6.1.0 | |
id: git_diff | |
with: | |
PATTERNS: | | |
**/**.go | |
go.mod | |
go.sum | |
- name: Build 🔨 | |
if: "env.GIT_DIFF != ''" | |
run: make build | |
- name: Test & Coverage report creation 🧪 | |
run: make test-unit stop-docker-test | |
- name: Upload coverage 📤 | |
if: "env.GIT_DIFF != ''" | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./coverage.txt |