Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Charlie17Li pushed module-controller code #51

Charlie17Li pushed module-controller code

Charlie17Li pushed module-controller code #51

name: Module Controller Unit Test
run-name: ${{ github.actor }} pushed module-controller code
on:
push:
branches:
- master
paths:
- 'module-controller/**'
pull_request:
branches:
- master
paths:
- 'module-controller/**'
# enable manually running the workflow
workflow_dispatch:
env:
CGO_ENABLED: 0
GOOS: linux
WORK_DIR: module-controller
defaults:
run:
working-directory: module-controller
jobs:
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up go
uses: actions/setup-go@v4
with:
go-version: '1.20.5'
cache-dependency-path: ${{ env.WORK_DIR }}/go.sum
- name: Run go mod
run: go mod download
- name: Build
run: go build -a -o manager cmd/main.go
- name: Test
run: go test -v -json ./internal/controller > TestResults.json
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: Test-Results
path: ${{ env.WORK_DIR }}/TestResults.json