-
Notifications
You must be signed in to change notification settings - Fork 19
44 lines (41 loc) · 1.61 KB
/
golangci-lint.yml
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
name: golangci-lint
on:
push:
pull_request:
permissions:
contents: read
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Load .env file
uses: cardinalby/export-env-action@v2
with:
envFile: .env
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GOLANG_VERSION }}
cache: false
- name: Install sorx
run: |
sudo apt-get update
sudo apt-get install -y libsoxr-dev
- name: Install onnxruntime library and headers
run: |
export ONNXRUNTIME_ROOT_PATH=$GITHUB_WORKSPACE/onnxruntime
LATEST_VERSION=$(wget -qO- https://api.github.com/repos/microsoft/onnxruntime/releases/latest | jq -r .tag_name)
ONNX_ARCH=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64" || echo "x64")
wget https://github.com/microsoft/onnxruntime/releases/download/${LATEST_VERSION}/onnxruntime-linux-${ONNX_ARCH}-${LATEST_VERSION#v}.tgz
tar -xzf onnxruntime-linux-${ONNX_ARCH}-${LATEST_VERSION#v}.tgz
mv onnxruntime-linux-${ONNX_ARCH}-${LATEST_VERSION#v} ${ONNXRUNTIME_ROOT_PATH}
rm onnxruntime-linux-${ONNX_ARCH}-${LATEST_VERSION#v}.tgz
echo "C_INCLUDE_PATH=${ONNXRUNTIME_ROOT_PATH}/include" >> $GITHUB_ENV
echo "LD_RUN_PATH=${ONNXRUNTIME_ROOT_PATH}/lib" >> $GITHUB_ENV
echo "LIBRARY_PATH=${ONNXRUNTIME_ROOT_PATH}/lib" >> $GITHUB_ENV
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.61
args: --timeout=10m --build-tags onnx