Testing CGO #35
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: Testing CGO | |
on: | |
workflow_run: | |
workflows: [Testing] | |
types: | |
- completed | |
jobs: | |
test_cgo_full: | |
name: Test CGO | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.22 | |
- name: Vet | |
run: go vet ./... | |
shell: bash | |
- name: Extract branch name | |
shell: bash | |
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | |
id: extract_branch | |
- name: Docker Build CGO | |
run: | | |
GOPATH_BIN=$(go env GOPATH)/bin | |
export PATH="${GOPATH_BIN}:${PATH}" | |
docker build --build-arg CODECOV_TOKEN_ARG=${{ secrets.CODECOV_TOKEN }} --build-arg GIT_BRANCH_ARG=${{ steps.extract_branch.outputs.branch }} --build-arg MAKE_TARGET_ARG=test_cgo -t pmon3 . | |
- name: Docker Testing CGO | |
run: | | |
GOPATH_BIN=$(go env GOPATH)/bin | |
export PATH="${GOPATH_BIN}:${PATH}" | |
docker run -t pmon3 | |
- name: Finish | |
run: | | |
echo ":rocket: Testing complete!" >> $GITHUB_STEP_SUMMARY |