Skip to content

Commit

Permalink
Merge pull request #415 from Templum/develop
Browse files Browse the repository at this point in the history
🔀 Merging Develop into V1 for Release
  • Loading branch information
Templum authored Jan 29, 2024
2 parents 296f2e8 + 8bcde48 commit ad16c62
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 550 deletions.
66 changes: 6 additions & 60 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
Expand All @@ -47,7 +47,7 @@ jobs:
if: ${{ github.event_name == 'pull_request' }}

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.20.0
cache: false
Expand Down Expand Up @@ -78,57 +78,3 @@ jobs:
version: v1.51.1
# Optional: show only new issues if it's a pull request. The default value is `false`.
only-new-issues: true
integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Should hopefully give enough time for it to start prior to testing
- name: Start RabbitMQ
uses: getong/rabbitmq-action@v1.2
with:
rabbitmq version: "3.8.11"
host port: 5672
rabbitmq user: "user"
rabbitmq password: "pass"

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.20.0
cache: false

- name: K8S Cluster Setup
uses: helm/kind-action@v1.7.0

- name: Get Arkade
run: curl -sLS https://get.arkade.dev | sudo sh

- name: Get FaaS CLI
run: ark get faas-cli && sudo mv /home/runner/.arkade/bin/faas-cli /usr/local/bin/

- name: Setup OpenFaaS
run: ark install openfaas --basic-auth=false --set faasnetes.image=ghcr.io/openfaas/faas-netes:0.16.1 --set gateway.image=ghcr.io/openfaas/gateway:0.25.5

- name: Await OpenFaaS Port
run: kubectl -n openfaas wait --for=condition=available --timeout=600s deploy/gateway

- name: Forward OpenFaaS Port
run: kubectl port-forward --address localhost,127.0.0.1 -n openfaas svc/gateway 8080:8080 &

- name: Spawn Function
run: faas-cli store deploy figlet --annotation topic="Foo,Bar,Dead,Beef" --name integration

- name: Await Lambda Port
run: kubectl -n openfaas-fn wait --for=condition=available --timeout=600s deploy/integration

- name: Integration Test
run: go test --tags=integration ./...
16 changes: 8 additions & 8 deletions .github/workflows/code-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,32 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
golang:
name: Analyse Vulnerabilities
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Running govulncheck
uses: Templum/govulncheck-action@v0.10.1
uses: Templum/govulncheck-action@v1.0.0
docker:
name: Analyse Container
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build an image from Dockerfile
run: docker build -t templum/rabbitmq-connector:${{ github.sha }} .
Expand All @@ -60,6 +60,6 @@ jobs:
output: "trivy-results.sarif"

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "trivy-results.sarif"
14 changes: 7 additions & 7 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
Docker-Hub:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: templum/rabbitmq-connector, ghcr.io/templum/rabbitmq-connector
labels: |
Expand All @@ -37,30 +37,30 @@ jobs:
type=ref,event=branch,pattern={{branch}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2.2.0
uses: docker/setup-qemu-action@v3.0.0

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2.7.0
uses: docker/setup-buildx-action@v3.0.0

- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}

- name: Login to Docker Hub
uses: docker/login-action@v2.2.0
uses: docker/login-action@v3.0.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2.2.0
uses: docker/login-action@v3.0.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4.1.1
uses: docker/build-push-action@v5.1.0
with:
context: .
file: ./Dockerfile
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20.5-alpine as base_builder
FROM golang:1.21.6-alpine as base_builder

RUN apk --no-cache add ca-certificates git

Expand All @@ -19,7 +19,7 @@ RUN VERSION=$(git describe --all --exact-match $(git rev-parse HEAD) | grep tags
-X github.com/Templum/rabbitmq-connector/pkg/version.GitCommit=${GIT_COMMIT}" \
-a -installsuffix cgo -o rmq-connector .

FROM alpine:3.18.2
FROM alpine:3.19.1

RUN addgroup -S app \
&& adduser -S -g app app \
Expand Down
63 changes: 36 additions & 27 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,67 @@ module github.com/Templum/rabbitmq-connector
go 1.20

require (
github.com/docker/go-connections v0.4.0
github.com/docker/go-connections v0.5.0
github.com/openfaas/connector-sdk v0.0.0-20201220114541-89f0ffcc5448
github.com/openfaas/faas-provider v0.21.0
github.com/pkg/errors v0.9.1
github.com/spf13/afero v1.9.5
github.com/spf13/afero v1.11.0
github.com/streadway/amqp v1.0.0
github.com/stretchr/testify v1.8.4
github.com/testcontainers/testcontainers-go v0.20.1
github.com/valyala/fasthttp v1.48.0
go.uber.org/automaxprocs v1.5.2
github.com/testcontainers/testcontainers-go v0.27.0
github.com/valyala/fasthttp v1.51.0
go.uber.org/automaxprocs v1.5.3
gopkg.in/yaml.v2 v2.4.0
)

require (
dario.cat/mergo v1.0.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Microsoft/go-winio v0.6.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Microsoft/hcsshim v0.11.4 // indirect
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/cenkalti/backoff/v4 v4.2.0 // indirect
github.com/containerd/containerd v1.7.0 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/containerd/containerd v1.7.11 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/cpuguy83/dockercfg v0.3.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/docker v23.0.5+incompatible // indirect
github.com/docker/docker v24.0.7+incompatible // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/klauspost/compress v1.16.3 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/klauspost/compress v1.17.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/moby/patternmatcher v0.5.0 // indirect
github.com/moby/patternmatcher v0.6.0 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/term v0.0.0-20221128092401-c43b287e0e0f // indirect
github.com/moby/term v0.5.0 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b // indirect
github.com/opencontainers/image-spec v1.1.0-rc5 // indirect
github.com/opencontainers/runc v1.1.5 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/shirou/gopsutil/v3 v3.23.11 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/sys v0.7.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/time v0.1.0 // indirect
golang.org/x/tools v0.6.0 // indirect
google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect
google.golang.org/grpc v1.53.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea // indirect
golang.org/x/mod v0.11.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.10.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.4.0 // indirect
)
Loading

0 comments on commit ad16c62

Please sign in to comment.