Skip to content

Go test darwin

Go test darwin #1046

name: Go test darwin
on:
pull_request:
branches: [main]
schedule:
- cron: "15 7 * * *"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
permissions: {}
jobs:
go-test-darwin:
name: "Go test with OS: ${{ matrix.os }}; Go: ${{ matrix.go }}"
permissions:
contents: read
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
go: ["1.26"]
os: [macos-latest]
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Setup go ${{ matrix.go }}
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go }}
- name: Set up gotestfmt
uses: gotesttools/gotestfmt-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run go test
run: |
go test -json -v -p 1 -coverprofile=./cover.out -covermode=atomic -coverpkg=./... ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
- name: Store coverage file
uses: actions/upload-artifact@v7
with:
name: cover.out
path: ./cover.out
- name: Upload test log
uses: actions/upload-artifact@v7
if: always()
with:
name: test-log
path: /tmp/gotest.log
if-no-files-found: error
coverage:
name: Coverage
needs: go-test-darwin
permissions:
contents: read
uses: senzing-factory/build-resources/.github/workflows/go-coverage.yaml@v4
with:
coverage-config: ./.github/coverage/testcoverage.yaml
slack-notification:
needs: [go-test-darwin]
if: ${{ always() && contains(fromJSON('["failure", "cancelled"]'), needs.go-test-darwin.result ) && github.event_name == 'schedule' }}
secrets:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
uses: senzing-factory/build-resources/.github/workflows/build-failure-slack-notification.yaml@v4
with:
job-status: ${{ needs.go-test-darwin.result }}