-
Notifications
You must be signed in to change notification settings - Fork 4
87 lines (76 loc) · 2.24 KB
/
go.yaml
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
# Tests only run with --short, since the full tests involve downloading datasets
# and would be too costly for a Github actions.
# Locally in the development box it works because the datasets are cached.
name: "Tests" # The name of the workflow that will appear on Github
permissions:
# read|write|none
actions: read
checks: read
contents: write
deployments: read
# id-token: read --> doesn't work
issues: read
discussions: read
packages: read
pages: read
pull-requests: write
repository-projects: read
security-events: read
statuses: read
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install apt packages
shell: bash
run: |
sudo apt-get install -y --no-install-recommends \
"wget" "gcc" "libunwind8" "libunwind-dev" "liblzma5" "hdf5-tools"
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.23.x"
- name: Install gopjrt shared libraries
shell: bash
run: |
curl -s "https://raw.githubusercontent.com/gomlx/gopjrt/main/cmd/install.sh" \
> /tmp/gopjrt_install.sh
chmod a+x /tmp/gopjrt_install.sh
echo "Installing gopjrt:"
/tmp/gopjrt_install.sh
- name: PreTest
run: |
export LD_LIBRARY_PATH=/usr/local/lib
go test ./graph
- name: Test
run: |
export LD_LIBRARY_PATH=/usr/local/lib
go test -short ./...
- name: Go Coverage Badge
uses: tj-actions/coverage-badge-go@v2
with:
green: 80
filename: docs/coverage.out
- name: Commit README.md changes
run: |
if git diff --quiet -- 'README.md' ; then
echo "README.md not modified."
else
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add README.md
git commit -m "chore: Updated coverage badge."
fi
- name: Push Changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ github.token }}
branch: ${{ github.ref }}