Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
navid.shariaty committed Oct 28, 2023
1 parent ddda7a3 commit d6cdd9a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 36 deletions.
38 changes: 27 additions & 11 deletions .github/workflows/build_and_push.yaml → .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,44 @@
---
name: Build And Push image

name: ci
on:
push:
branches: [ main ]
tags: [ v* ]
pull_request:
branches: [ main ]

jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: latest
args: --timeout 5m
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: run tests using make
run: make test
docker:
name: docker
runs-on: ubuntu-latest
needs:
- lint
- test
steps:
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v3
- uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/${{ github.repository }}
Expand All @@ -33,11 +47,13 @@ jobs:
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- uses: docker/build-push-action@v2
type=semver,pattern={{major}}
type=sha
- uses: docker/build-push-action@v5
with:
file: "Dockerfile"
context: .
platforms: linux/amd64
push: true
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
25 changes: 0 additions & 25 deletions .github/workflows/lint_and_test.yaml

This file was deleted.

5 changes: 5 additions & 0 deletions controllers/agesecret_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ var _ = Describe("", func() {
Expect(string(testKeyValue)).Should(Equal("test_value"))
Expect(exists).To(BeTrue())

// Remove secret, it should be created again
err = k8sClient.Delete(ctx, fooSecretObj)
err = k8sClient.Get(ctx, types.NamespacedName{Namespace: validAgeSecretObj.Namespace, Name: validAgeSecretObj.Name}, fooSecretObj)
Expect(err).To(BeNil())

err = k8sClient.Delete(ctx, validAgeKeyObj)
Expect(err).To(BeNil())

Expand Down

0 comments on commit d6cdd9a

Please sign in to comment.