mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 19:13:34 +00:00
70 lines
1.8 KiB
YAML
70 lines
1.8 KiB
YAML
name: Go Tests
|
|
on:
|
|
push:
|
|
branches:
|
|
- "main"
|
|
- "test/**"
|
|
- "release/**"
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- ".github/**"
|
|
- "**.go"
|
|
- "**.proto"
|
|
- "go.*"
|
|
- "Makefile"
|
|
- "scripts/**"
|
|
- "test/**"
|
|
permissions:
|
|
contents: read
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
|
with:
|
|
go-version: "1.25.1"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
go mod tidy
|
|
git diff --exit-code ||
|
|
(echo "go.mod or go.sum has changed. Please run 'go mod tidy' and commit the changes." && exit 1)
|
|
|
|
- name: Run tests
|
|
run: |
|
|
make ucind-image
|
|
make test
|
|
timeout-minutes: 15
|
|
|
|
check-protobuf:
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 10
|
|
strategy:
|
|
matrix:
|
|
# Run on more platforms so that mise lockfile checksums are checked/generated for all platforms.
|
|
# See https://github.com/jdx/mise/issues/4276 for details.
|
|
os: [ubuntu-latest, macos-latest]
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
|
|
- name: Install Mise
|
|
uses: jdx/mise-action@13abe502c30c1559a5c37dff303831bab82c9402 # v2.2.3
|
|
with:
|
|
version: "2025.9.6"
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
|
|
- name: Generate Protobuf files
|
|
run: |
|
|
make proto
|
|
# check if the generated files are up to date
|
|
git diff --exit-code ||
|
|
(echo "Generated protobuf files are not up to date. Please run 'make proto' and commit the changes." && exit 1)
|