Skip to content

Go

Go #24331

Workflow file for this run

---
name: Go
on:
workflow_dispatch: null
push:
branches:
- main
pull_request:
branches:
- main
schedule:
# Run full test once a day
- cron: "0 0 * * *"
permissions: {}
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: free disk space
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
sudo swapoff -a
sudo rm -f /swapfile
sudo apt clean
sudo docker image prune --all --force
sudo docker builder prune -a
df -h
# https://github.com/actions/setup-go
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
cache: false
go-version: 1.26.4
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: golangci-lint
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
# Required: the version of golangci-lint is required
# and must be specified without patch version:
# we always use the latest patch version.
version: v2.9.0
install-mode: "binary"
- uses: "pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093" # v6.0.8
with:
version: "11.10.0"
run_install: false
- name: Install Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "26.4.0"
package-manager-cache: false
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
version: "0.11.26"
enable-cache: false
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # v7.0.0
with:
install-only: true
- name: Show GoReleaser version
run: goreleaser --version
- name: Build
run: make build
- name: Quick Test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make test-short
if: ${{ github.event_name == 'pull_request' }}
- name: All Test
env:
# Access only to ec2 AMI api in read-only
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
UPDATECLI_GITEA_TOKEN: ${{ secrets.UPDATECLI_GITEA_TOKEN }}
run: make test
if: ${{ github.event_name == 'schedule' }}
# Codecov should only be updated if make test is executed
- name: Upload coverage to Codecov
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
if: ${{ github.event_name == 'schedule' }}
with:
fail_ci_if_error: false
env:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
# Manage and run your integration tests with efficiency
# https://github.com/ovh/venom
- name: Install Venom
run: |
curl -o /usr/local/bin/venom https://github.com/ovh/venom/releases/download/$VENOM_VERSION/venom.linux-amd64 -L
sudo chmod +x /usr/local/bin/venom
ls -lha /usr/local/bin/venom
env:
VENOM_VERSION: v1.3.0
- name: Show Venom version
run: venom version
- name: Run End to End tests
run: make test-e2e
env:
IS_TTY: true # https://github.com/ovh/venom#use-venom-in-ci
# Access only to ec2 AMI api in read-only
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OTEL_TRACES_EXPORTER: console