Skip to content

CI/CD: update the version of go build #46

CI/CD: update the version of go build

CI/CD: update the version of go build #46

name: Build Rule server
on:
push:
branches:
- main
pull_request:
paths:
- "ruleserver/**"
- ".github/workflows/build-ruleserver.yaml"
jobs:
build-ruleserver:
runs-on: ubuntu-20.04
defaults:
run:
working-directory: ./ruleserver
steps:
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
- name: Check out code
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Setup go
uses: actions/setup-go@v1
with:
go-version: "1.21"
- name: Check go.mods
uses: evantorrie/mott-the-tidier@v1-beta
with:
gomods: |
**/go.mod
- name: download dependencies
run: go get ./...
- name: Build server
run: CGO_ENABLED=0 go build main.go
- name: Run tests
run: make test
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push
uses: docker/build-push-action@v2
with:
context: ./ruleserver
push: false