-
Notifications
You must be signed in to change notification settings - Fork 18
90 lines (77 loc) · 2.81 KB
/
ci_go.yml
File metadata and controls
90 lines (77 loc) · 2.81 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
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
name: Go
on:
workflow_call:
secrets:
CODECOV_TOKEN:
required: false
defaults:
run:
shell: bash
env:
GH_TOKEN: "${{ github.token }}"
GIT_COMMIT: "${{ github.sha }}"
NEMO_RELAY_CI_WORKSPACE: "${{ github.workspace }}"
NEMO_RELAY_CI_WORKSPACE_TMP: "${{ github.workspace }}/tmp"
UV_PYTHON_DOWNLOADS: never
jobs:
Test:
name: Test (${{ matrix.platform }})
runs-on: ${{ matrix.runner }}
timeout-minutes: 120
continue-on-error: ${{ startsWith(matrix.platform, 'windows') }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- platform: linux-amd64
runner: ubuntu-latest
- platform: linux-arm64
runner: ubuntu-24.04-arm
- platform: macos-arm64
runner: macos-15
- platform: windows-amd64
runner: windows-2022
- platform: windows-arm64
runner: windows-11-arm
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Load CI tool versions
id: ci-config
uses: ./.github/actions/load-ci-tool-versions
- uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
with:
cache: false
toolchain: ${{ steps.ci-config.outputs.rust_version }}
- uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
with:
tool: cargo-llvm-cov@${{ steps.ci-config.outputs.cargo_llvm_cov_version }},just@${{ steps.ci-config.outputs.just_version }}
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
shared-key: nemo-relay-rust-${{ runner.os }}-${{ runner.arch }}-${{ steps.ci-config.outputs.rust_version }}
workspaces: . -> target
cache-all-crates: true
cache-bin: false
save-if: false
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version: ${{ steps.ci-config.outputs.go_version }}
cache: false
- name: Run Go tests with coverage
working-directory: ${{ env.NEMO_RELAY_CI_WORKSPACE }}
run: |
set -e
just --set ci true --set output_dir "${{ github.workspace }}" test-go
- name: Upload Go coverage to Codecov
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
disable_search: true
files: go-coverage.xml
flags: go-${{ matrix.platform }}
name: go-${{ matrix.platform }}
verbose: true