Skip to content

Commit

Permalink
Add CI Stages for MR tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mowirth committed Dec 23, 2023
1 parent 71d98e7 commit ef0b4d9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,24 @@ on:
- '*'
pull_request:
jobs:
test:
name: "Test Htpasswd Operator"
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.21.x
- name: Checkout Code
uses: actions/checkout@v2
- name: Run Linter
run: make lint
- name: Build
run: make build
dist:
name: Deploy to Container Registry
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/v1'
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,10 @@ build:
@go install -v ./...
clean:
@rm -rf bin/
lint: bin/golangci-lint
bin/golangci-lint run --fix --timeout=600s
bin/golangci-lint: bin/golangci-lint-${GOLANGCI_VERSION}
@ln -sf golangci-lint-${GOLANGCI_VERSION} bin/golangci-lint
bin/golangci-lint-${GOLANGCI_VERSION}:
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s ${GOLANGCI_VERSION}
@mv bin/golangci-lint $@

0 comments on commit ef0b4d9

Please sign in to comment.