Skip to content

Commit e6dcea0

Browse files
authored
Merge branch 'development' into feat/gcs-file-provider
2 parents 6b0bf66 + 79989b2 commit e6dcea0

File tree

66 files changed

+1009
-256
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1009
-256
lines changed

.github/workflows/go.yml

Lines changed: 47 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
services:
3838
# Kafka service
3939
kafka:
40-
image: bitnami/kafka:3.4
40+
image: bitnami/kafka:3.4.1
4141
ports:
4242
- "9092:9092"
4343
env:
@@ -275,45 +275,52 @@ jobs:
275275
name: submodule-coverage-reports
276276
path: coverage_reports/*.cov
277277

278-
# Job for uploading coverage to external services (CodeClimate)
279-
# upload_coverage:
280-
# name: Upload Coverage📊
281-
# runs-on: ubuntu-latest
282-
# # This job only needs example and pkg test results, not submodules
283-
# needs: [Example-Unit-Testing, PKG-Unit-Testing]
284-
# # Only run this job on pushes to the development branch
285-
# if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development'}}
286-
# steps:
287-
# - name: Check out code into the Go module directory
288-
# uses: actions/checkout@v5
289-
#
290-
# # Download coverage artifacts
291-
# - name: Download Coverage Report
292-
# uses: actions/download-artifact@v5
293-
# with:
294-
# path: artifacts
295-
#
296-
# # Merge coverage from example and pkg tests only
297-
# - name: Merge Coverage Files
298-
# working-directory: artifacts
299-
# run: |
300-
# echo "mode: set" > merged_profile.cov
301-
# tail -n +2 ./Example-Test-Report/profile.cov >> merged_profile.cov
302-
# tail -n +2 ./PKG-Coverage-Report/profile.cov >> merged_profile.cov
303-
#
304-
# # Generate and print total coverage percentage
305-
# echo "Total Coverage:"
306-
# go tool cover -func=merged_profile.cov | tail -n 1
307-
# shell: bash
308-
#
309-
# # Upload merged coverage to CodeClimate for analysis
310-
# - name: Upload
311-
# uses: paambaati/[email protected]
312-
# env:
313-
# CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
314-
# with:
315-
# coverageLocations: artifacts/merged_profile.cov:gocov
316-
# prefix: gofr.dev
278+
# Job for uploading coverage to external services (qlty.sh)
279+
upload_coverage:
280+
name: Upload Coverage📊
281+
runs-on: ubuntu-latest
282+
env:
283+
QLTY_TOKEN: ${{ secrets.QLTY_TOKEN }}
284+
QLTY_COVERAGE_TOKEN: ${{ secrets.QLTY_TOKEN }}
285+
286+
# This job only needs example and pkg test results, not submodules
287+
needs: [Example-Unit-Testing, PKG-Unit-Testing]
288+
# Only run this job on pushes to the development branch
289+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development'}}
290+
steps:
291+
- name: Check out code into the Go module directory
292+
uses: actions/checkout@v5
293+
294+
- name: Install qlty CLI
295+
run: |
296+
curl https://qlty.sh | sh
297+
echo "$HOME/.qlty/bin" >> $GITHUB_PATH
298+
299+
# Download coverage artifacts
300+
- name: Download Coverage Report
301+
uses: actions/download-artifact@v5
302+
with:
303+
path: artifacts
304+
305+
# Merge coverage from example and pkg tests only
306+
- name: Merge Coverage Files
307+
working-directory: artifacts
308+
run: |
309+
echo "mode: set" > merged_profile.cov
310+
tail -n +2 ./Example-Test-Report/profile.cov >> merged_profile.cov
311+
tail -n +2 ./PKG-Coverage-Report/profile.cov >> merged_profile.cov
312+
313+
# Generate and print total coverage percentage
314+
echo "Total Coverage:"
315+
go tool cover -func=merged_profile.cov | tail -n 1
316+
shell: bash
317+
318+
# Upload merged coverage to CodeClimate for analysis
319+
- name: Upload
320+
working-directory: artifacts
321+
run: qlty coverage publish merged_profile.cov --format=coverprofile --strip-prefix="gofr.dev/" --add-prefix="${GITHUB_WORKSPACE}/"
322+
env:
323+
QLTY_TOKEN: ${{ secrets.QLTY_TOKEN }}
317324

318325
# Job for code quality checks
319326
code_quality:

.github/workflows/typos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ jobs:
1111
- name: Checkout Code
1212
uses: actions/checkout@v5
1313
- name: typos-action
14-
uses: crate-ci/[email protected].3
14+
uses: crate-ci/[email protected].5

.github/workflows/website.yml renamed to .github/workflows/website-prod.yml

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ on:
66
push:
77
tags:
88
- "v*.*.*"
9-
branches:
10-
- main
11-
- development
9+
1210
env:
1311
APP_NAME: gofr-website
1412
WEBSITE_REGISTRY: ghcr.io
@@ -39,7 +37,7 @@ jobs:
3937
with:
4038
registry: us-central1-docker.pkg.dev
4139
username: _json_key
42-
password: ${{ secrets.deploy_key }}
40+
password: ${{ secrets.GOFR_WEBSITE_GOFR_DEV_DEPLOYMENT_KEY }}
4341

4442
- name: Log in to the GitHub Container registry
4543
uses: docker/login-action@v3
@@ -74,35 +72,7 @@ jobs:
7472
- id: output-image
7573
run: echo "image=`echo us-central1-docker.pkg.dev/${{ env.GAR_PROJECT }}/${{ env.GAR_REGISTRY }}/${{ env.APP_NAME }}:${{ env.TAG }}`" >> "$GITHUB_OUTPUT"
7674

77-
deployment_stage:
78-
runs-on: ubuntu-latest
79-
if: ${{ github.ref == 'refs/heads/development' }}
80-
name: 🚀 Deploy-Stage
81-
needs: dockerize
82-
container:
83-
image: ghcr.io/zopsmart/gha-images:deployments-0.1.3
84-
options: --rm
85-
env:
86-
image: ${{needs.dockerize.outputs.image}}
87-
88-
steps:
89-
- name: Checkout Code
90-
uses: actions/checkout@v5
91-
92-
- name: Authorize to GCP service account
93-
uses: google-github-actions/auth@v2
94-
with:
95-
credentials_json: ${{ secrets.deploy_key }}
96-
97-
- name: Set GCloud Project and Fetch Cluster Credentials
98-
run: gcloud container clusters get-credentials ${{ env.CLUSTER_NAME }} --region=us-central1 --project=${{ env.CLUSTER_PROJECT }}
99-
100-
- name: Update Deployment Image
101-
run: kubectl set image deployment/${{ env.APP_NAME }} ${{ env.APP_NAME }}=${{ env.image }} --namespace ${{ env.NAMESPACE_STAGE }}
102-
103-
10475
deployment:
105-
if: ${{ startsWith(github.ref, 'refs/tags/v')}}
10676
runs-on: ubuntu-latest
10777
name: 🚀 Deploy-Prod
10878
needs: dockerize
@@ -119,7 +89,7 @@ jobs:
11989
- name: Authorize to GCP service account
12090
uses: google-github-actions/auth@v2
12191
with:
122-
credentials_json: ${{ secrets.deploy_key }}
92+
credentials_json: ${{ secrets.GOFR_WEBSITE_GOFR_DEV_DEPLOYMENT_KEY }}
12393

12494
- name: Set GCloud Project and Fetch Cluster Credentials
12595
run: gcloud container clusters get-credentials ${{ env.CLUSTER_NAME }} --region=us-central1 --project=${{ env.CLUSTER_PROJECT }}

.github/workflows/website-stage.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Build and Deploy Website To Stage
2+
permissions:
3+
contents: read
4+
5+
on:
6+
push:
7+
branches:
8+
- development
9+
10+
env:
11+
APP_NAME: gofr-website
12+
WEBSITE_REGISTRY: ghcr.io
13+
GAR_PROJECT: raramuri-tech
14+
GAR_REGISTRY: kops-dev
15+
CLUSTER_NAME: raramuri-tech
16+
CLUSTER_PROJECT: raramuri-tech
17+
NAMESPACE: gofr-dev
18+
NAMESPACE_STAGE: gofr-dev-stg
19+
20+
jobs:
21+
dockerize:
22+
permissions:
23+
contents: read
24+
packages: write
25+
runs-on: ubuntu-latest
26+
outputs:
27+
image: ${{ steps.output-image.outputs.image }}
28+
name: 🐳 Dockerize
29+
steps:
30+
- name: Checkout Code
31+
uses: actions/checkout@v5
32+
33+
- name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v3
35+
36+
- name: Login to GAR
37+
uses: docker/login-action@v3
38+
with:
39+
registry: us-central1-docker.pkg.dev
40+
username: _json_key
41+
password: ${{ secrets.GOFR_WEBSITE_GOFR_DEV_STG_DEPLOYMENT_KEY }}
42+
43+
- name: Log in to the GitHub Container registry
44+
uses: docker/login-action@v3
45+
with:
46+
registry: ${{ env.WEBSITE_REGISTRY }}
47+
username: ${{ github.actor }}
48+
password: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Download UI Image
51+
run: |
52+
docker pull ${{ env.WEBSITE_REGISTRY }}/gofr-dev/website:latest
53+
54+
- name: Determine Image Tag
55+
id: determine-tag
56+
run: |
57+
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
58+
TAG=${GITHUB_REF#refs/tags/}
59+
else
60+
TAG=${{ github.sha }}
61+
fi
62+
echo "TAG=$TAG" >> $GITHUB_ENV
63+
64+
65+
- name: Build and Push Image
66+
uses: docker/build-push-action@v6
67+
with:
68+
push: true
69+
context: ./
70+
file: ./docs/Dockerfile
71+
tags: us-central1-docker.pkg.dev/${{ env.GAR_PROJECT }}/${{ env.GAR_REGISTRY }}/${{ env.APP_NAME }}:${{ env.TAG }}
72+
73+
- id: output-image
74+
run: echo "image=`echo us-central1-docker.pkg.dev/${{ env.GAR_PROJECT }}/${{ env.GAR_REGISTRY }}/${{ env.APP_NAME }}:${{ env.TAG }}`" >> "$GITHUB_OUTPUT"
75+
76+
deployment_stage:
77+
runs-on: ubuntu-latest
78+
name: 🚀 Deploy-Stage
79+
needs: dockerize
80+
container:
81+
image: ghcr.io/zopsmart/gha-images:deployments-0.1.3
82+
options: --rm
83+
env:
84+
image: ${{needs.dockerize.outputs.image}}
85+
86+
steps:
87+
- name: Checkout Code
88+
uses: actions/checkout@v5
89+
90+
- name: Authorize to GCP service account
91+
uses: google-github-actions/auth@v2
92+
with:
93+
credentials_json: ${{ secrets.GOFR_WEBSITE_GOFR_DEV_STG_DEPLOYMENT_KEY }}
94+
95+
- name: Set GCloud Project and Fetch Cluster Credentials
96+
run: gcloud container clusters get-credentials ${{ env.CLUSTER_NAME }} --region=us-central1 --project=${{ env.CLUSTER_PROJECT }}
97+
98+
- name: Update Deployment Image
99+
run: kubectl set image deployment/${{ env.APP_NAME }} ${{ env.APP_NAME }}=${{ env.image }} --namespace ${{ env.NAMESPACE_STAGE }}

.qlty/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*
2+
!configs
3+
!configs/**
4+
!hooks
5+
!hooks/**
6+
!qlty.toml
7+
!.gitignore

.qlty/configs/.hadolint.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ignored:
2+
- DL3008

.qlty/configs/.yamllint.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
rules:
2+
document-start: disable
3+
quoted-strings:
4+
required: only-when-needed
5+
extra-allowed: ["{|}"]
6+
key-duplicates: {}
7+
octal-values:
8+
forbid-implicit-octal: true

0 commit comments

Comments
 (0)