Skip to content

Merge pull request #35 from gnmic/dependabot/go_modules/go_modules-9c… #98

Merge pull request #35 from gnmic/dependabot/go_modules/go_modules-9c…

Merge pull request #35 from gnmic/dependabot/go_modules/go_modules-9c… #98

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- 'docs/**'
- '**.md'
pull_request:
branches:
- main
paths-ignore:
- 'docs/**'
- '**.md'
env:
GO_VERSION: '1.25'
jobs:
# lint:
# name: Lint
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# - name: Setup Go
# uses: actions/setup-go@v6
# with:
# go-version: ${{ env.GO_VERSION }}
# cache: true
# - name: Run golangci-lint
# uses: golangci/golangci-lint-action@v8
# with:
# version: v2.8.0
test:
name: Test
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Run tests
run: make test
- name: Upload coverage
uses: codecov/codecov-action@v5
with:
files: ./cover.out
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
build:
name: Build
runs-on: ubuntu-latest
needs: test
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Build binary
run: make build
- name: Build Docker image
run: make docker-build IMG=gnmic-operator:ci
manifests:
name: Verify Manifests
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Generate manifests
run: make manifests generate
- name: Check for uncommitted changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "::error::Generated manifests are out of date. Please run 'make manifests generate' and commit the changes."
git diff
exit 1
fi
integration-test:
name: Integration Test
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Run integration tests
run: make run-integration-tests IMG=gnmic-operator:ci