Skip to content

feat : test unit fix #159

feat : test unit fix

feat : test unit fix #159

Workflow file for this run

name: Go
on:
push:
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.22
- name: Setup Zookeeper
run: docker run -itd -h kerberos.example.com -p 88:88 -p 749:749 -p 2181:2181 123shang60/kerberos-zookeeper:3.8.0
- name: Setup Minio
run: docker run -itd -p 9000:9000 -e "MINIO_ROOT_USER=minioadmin" -e "MINIO_ROOT_PASSWORD=minioadmin" minio/minio server /data
- name: Go Mod
run: go mod tidy -v
- name: Build
run: make manifests generate build
- name: Test
run: make manifests generate test
deploy:
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v3
- name: Extract Version
id: version_step
run: |
echo "version_tag=$GITHUB_REPOSITORY:${GITHUB_REF#$"refs/tags/v"}" >> $GITHUB_OUTPUT
echo "latest_tag=$GITHUB_REPOSITORY:latest" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.22
- name: Go Mod
run: go mod tidy -v
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: PrepareReg Names
id: read-docker-image-identifiers
run: |
echo VERSION_TAG=$(echo ${{ steps.version_step.outputs.version_tag }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
echo LASTEST_TAG=$(echo ${{ steps.version_step.outputs.latest_tag }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build and push Docker images
id: docker_build
run: |
make container IMG=${{ env.VERSION_TAG }}
make container IMG=${{ env.LASTEST_TAG }}