Skip to content

fix go.mod

fix go.mod #8

Workflow file for this run

# 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: Go
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21.x'
- name: Run Test
run: go test ./src/pkg/interpreter/interpreter_test.go -coverprofile=./cover.out -covermode=atomic -coverpkg=./src/pkg/...
- name: check test coverage
uses: vladopajic/go-test-coverage@v2
with:
# Configure action using config file (option 1)
config: ./.testcoverage.yml
# Configure action by specifying input parameters individually (option 2)
profile: cover.out
local-prefix: github.com/hutcho66/glox/src/pkg
threshold-file: 0
threshold-package: 0
threshold-total: 80
- name: make coverage badge
uses: action-badges/core@0.2.2
if: contains(github.ref, 'main')
with:
label: coverage
message: ${{ steps.coverage.outputs.badge-text }}
message-color: ${{ steps.coverage.outputs.badge-color }}
file-name: coverage.svg
badge-branch: badges ## orphan branch where badge will be committed
github-token: "${{ secrets.GITHUB_TOKEN }}"