From 20305e6de9b4856db22a93426f738c14502afaa7 Mon Sep 17 00:00:00 2001 From: Simon Murray Date: Tue, 14 May 2024 15:01:34 +0100 Subject: [PATCH] Add CI Jobs --- .github/workflows/pull-request.yaml | 35 +++++++++++++++++++++++++++++ Makefile | 6 +++++ 2 files changed, 41 insertions(+) create mode 100644 .github/workflows/pull-request.yaml diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml new file mode 100644 index 0000000..3388cdf --- /dev/null +++ b/.github/workflows/pull-request.yaml @@ -0,0 +1,35 @@ +name: Unikorn Push +on: + pull_request: + types: + - opened + - synchronize + - reopened + - ready_for_review +env: + GO_VERSION: 1.22.1 +jobs: + Static: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: ${{ env.GO_VERSION }} + cache: true + - name: License Checker + run: make license + Runtime: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: ${{ env.GO_VERSION }} + cache: true + - name: Golang CI/Helm Lint + run: make lint diff --git a/Makefile b/Makefile index 44ef9d0..dd1c3da 100644 --- a/Makefile +++ b/Makefile @@ -11,3 +11,9 @@ LINT_VERSION=v1.57.1 lint: $(GENDIR) @go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(LINT_VERSION) $(GOBIN)/golangci-lint run ./... + +# Perform license checking. +# This must pass or you will be denied by CI. +.PHONY: license +license: + go run github.com/unikorn-cloud/core/hack/check_license