I have a simple go package, but during testing within Github Actions, it is failing with this error:
##[error]keywords.go:8:2: cannot find package "github.com/securisec/go-keywords/languages" in any of:.
When I run the tests locally (I am using go mod), all the tests works fine.
For Github actions, I have tried setting GO111MODULE to both on and off, but still getting the same error.
The error can be observed here. My testing workflow is:
name: tests
on:
- push
- pull_request
jobs:
test:
name: Test package
strategy:
max-parallel: 3
fail-fast: false
matrix:
os:
- ubuntu-latest
go:
- "1.11"
- "1.13"
- "1.14"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
env:
GOPATH: ${{ runner.workspace }}
GO111MODULE: "on"
- name: Go setup
uses: actions/setup-go@v1.0.0
with:
go-version: ${{matrix.go}}
env:
GOPATH: ${{ runner.workspace }}
GO111MODULE: "on"
- name: Run test
env:
GOPATH: ${{ runner.workspace }}
GO111MODULE: "on"
run: |
go get -u github.com/grokify/html-strip-tags-go
go test ./...
- if: failure()
run: ls -R
Go mod file:
module github.com/securisec/go-keywords
go 1.14
require github.com/grokify/html-strip-tags-go v0.0.0-20200322061010-ea0c1cf2f119
How can I fix this error?