-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (103 loc) · 3.94 KB
/
go-test-darwin.yaml
File metadata and controls
121 lines (103 loc) · 3.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Go test darwin
on:
pull_request:
branches: [main]
schedule:
- cron: "15 7 * * *"
workflow_dispatch:
env:
SENZING_LOG_LEVEL: TRACE
SENZING_TOOLS_DATABASE_URL: sqlite3://na:na@nowhere/tmp/sqlite/G2C.db
permissions: {}
jobs:
go-test-darwin:
name: "Go test with Senzing: ${{ matrix.senzingsdk-version }}; OS: ${{ matrix.os }}; Go: ${{ matrix.go }}"
outputs:
status: ${{ job.status }}
permissions:
contents: read
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
go: ["1.24"]
os: [macos-latest]
senzingsdk-version: [production-v4, staging-v4]
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: Install Senzing SDK
uses: senzing-factory/github-action-install-senzing-sdk@v3
with:
senzingsdk-version: ${{ matrix.senzingsdk-version }}
- name: Set environment variables
run: |
SENZING_PATH="${HOME}/senzing"
{
echo "SENZING_PATH=${SENZING_PATH}"
echo "LD_LIBRARY_PATH=${SENZING_PATH}/er/lib:${SENZING_PATH}/er/lib/macos"
echo "DYLD_LIBRARY_PATH=${SENZING_PATH}/er/lib:${SENZING_PATH}/er/lib/macos"
echo CGO_CFLAGS="-g -I${SENZING_PATH}/er/sdk/c"
echo CGO_LDFLAGS="-L${SENZING_PATH}/er/lib -lSz -Wl,-no_warn_duplicate_libraries"
} >> "$GITHUB_ENV"
# - name: Copy /etc files
# run: |
# sudo mkdir -p "${SENZING_PATH}/etc"
# sudo cp testdata/senzing-license/g2.lic "${SENZING_PATH}/er/etc/g2.lic"
- name: Copy test database files
run: |
mkdir -p /tmp/sqlite
cp testdata/sqlite/G2C.db /tmp/sqlite/
- name: Enable core dumps
uses: senzing-factory/github-action-core-dumps@v1
with:
enable-core-dumps: "true"
- name: Run go test
run: |
ulimit -c unlimited
GOTRACEBACK=crash go test -exec "${GITHUB_WORKSPACE}/bin/macos_exec_dyld.sh" -json -v -p 1 -coverprofile="./cover-${{ matrix.senzingsdk-version }}.out" -covermode=atomic -coverpkg=./... ./... 2>&1 | tee "/tmp/gotest-${{ matrix.senzingsdk-version }}.log" | gotestfmt
- if: always()
name: Analyze core dumps
uses: senzing-factory/github-action-core-dumps@v1
with:
analyze-core-dumps: "true"
core-file-suffix: go-${{ matrix.os }}-${{ matrix.go }}-${{ matrix.senzingsdk-version }}
- name: Store coverage file
uses: actions/upload-artifact@v5
with:
name: "cover-${{ matrix.senzingsdk-version }}.out"
path: "./cover-${{ matrix.senzingsdk-version }}.out"
- name: Upload test log
uses: actions/upload-artifact@v5
if: always()
with:
name: "test-log-${{ matrix.senzingsdk-version }}"
path: "/tmp/gotest-${{ matrix.senzingsdk-version }}.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@v3
with:
coverage-config: ./.github/coverage/testcoverage.yaml
profile: "cover-production-v4.out,cover-staging-v4.out"
slack-notification:
needs: [go-test-darwin]
if: ${{ always() && contains(fromJSON('["failure", "cancelled"]'), needs.go-test-darwin.outputs.status ) && github.event_name == 'schedule' }}
secrets:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: senzing-factory/build-resources/.github/workflows/build-failure-slack-notification.yaml@v3
with:
job-status: ${{ needs.go-test-darwin.outputs.status }}