From 4d25d7e019a3d8ef986628cf64a967d264c7cc25 Mon Sep 17 00:00:00 2001 From: Ron Rise Date: Wed, 16 Apr 2025 23:09:59 -0400 Subject: [PATCH] Fixing Qwertylex's bug. --- .gitea/workflows/build.yml | 52 +++++++++++++-------- .gitea/workflows/deploy.yml | 16 ++++--- .gitea/workflows/tests.yml | 90 ++++++++++++++++++------------------- 3 files changed, 89 insertions(+), 69 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index bcabf38..29d7f5a 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -7,86 +7,102 @@ name: Build jobs: BuildFrontend: - name: Build Frontend + name: ๐Ÿ”จ Build Frontend runs-on: ubuntu-latest steps: - - name: Add Siteworx CA + + - name: ๐Ÿ›ก Add Siteworx CA run: | apt update && apt install -yq ca-certificates curl curl -Ls https://siteworxpro.com/hosted/Siteworx+Root+CA.pem -o /usr/local/share/ca-certificates/sw.crt update-ca-certificates - - name: Checkout code + + - name: ๐Ÿ“– Checkout code uses: actions/checkout@v2 with: fetch-depth: 1 - - name: Login to Docker Hub + + - name: ๐Ÿ”‘ Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Login to Siteworx Registry + + - name: ๐Ÿ”‘ Login to Siteworx Registry uses: docker/login-action@v3 with: username: ${{ vars.SITEWORX_USERNAME }} password: ${{ secrets.SITEWORX_PASSWORD }} registry: scr.siteworxpro.com - - name: Set up Node.js + + - name: โš™๏ธ Set up Node.js uses: actions/setup-node@v2 with: node-version: '22.14.0' - - name: Build Container + + - name: ๐Ÿณ Build Container uses: docker/build-push-action@v6 with: context: ./frontend file: ./frontend/Dockerfile platforms: linux/amd64,linux/arm64 tags: scr.siteworxpro.com/reloading-manager/frontend:${{ gitea.ref_name }} - - name: Build Container + + - name: ๐Ÿ“ฆ Build Latest Container uses: docker/build-push-action@v6 with: context: ./frontend file: ./frontend/Dockerfile platforms: linux/amd64,linux/arm64 tags: scr.siteworxpro.com/reloading-manager/frontend:latest + BuildBackend: - name: Build Backend + name: ๐Ÿ”จ Build Backend runs-on: ubuntu-latest steps: - - name: Add Siteworx CA + + - name: ๐Ÿ›ก Add Siteworx CA run: | apt update && apt install -yq ca-certificates curl curl -Ls https://siteworxpro.com/hosted/Siteworx+Root+CA.pem -o /usr/local/share/ca-certificates/sw.crt update-ca-certificates - - name: Checkout code + + - name: ๐Ÿ“– Checkout code uses: actions/checkout@v2 with: fetch-depth: 1 - - name: Login to Docker Hub + + - name: ๐Ÿ”‘ Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Login to Siteworx Registry + + - name: ๐Ÿ”‘ Login to Siteworx Registry uses: docker/login-action@v3 with: username: ${{ vars.SITEWORX_USERNAME }} password: ${{ secrets.SITEWORX_PASSWORD }} registry: scr.siteworxpro.com - - name: Set up QEMU + + - name: โš™๏ธ Set up QEMU uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx + + - name: ๐Ÿ—๏ธ Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Build Container + + - name: ๐Ÿณ Build Container uses: docker/build-push-action@v6 with: context: ./backend file: ./backend/Dockerfile platforms: linux/amd64,linux/arm64 tags: scr.siteworxpro.com/reloading-manager/backend:${{ gitea.ref_name }} - - name: Build Container + + - name: ๐Ÿ“ฆ Build Latest Container uses: docker/build-push-action@v6 with: context: ./backend file: ./backend/Dockerfile platforms: linux/amd64,linux/arm64 - tags: scr.siteworxpro.com/reloading-manager/backend:latest + tags: scr.siteworxpro.com/reloading-manager/backend:latest \ No newline at end of file diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 6afbe40..5bcaef1 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -5,26 +5,30 @@ on: - completed jobs: Deploy: - name: Deploy + name: ๐Ÿš€ Deploy runs-on: ubuntu-latest steps: - - name: Add Siteworx CA + + - name: ๐Ÿ›ก Add Siteworx CA run: | apt update && apt install -yq ca-certificates curl curl -Ls https://siteworxpro.com/hosted/Siteworx+Root+CA.pem -o /usr/local/share/ca-certificates/sw.crt update-ca-certificates - - name: Checkout code + + - name: ๐Ÿ“– Checkout code uses: actions/checkout@v2 with: fetch-depth: 1 - - name: Update Deployment Manifest + + - name: ๐Ÿ“ Update Deployment Manifest run: | sed "s|scr.siteworxpro.com/reloading-manager/frontend:__TAG__|scr.siteworxpro.com/reloading-manager/frontend:${{ gitea.ref_name }}|g" argocd/template/deployment.yml > argocd/deployment/deployment.yml sed "s|scr.siteworxpro.com/reloading-manager/backend:__TAG__|scr.siteworxpro.com/reloading-manager/backend:${{ gitea.ref_name }}|g" argocd/template/deployment.yml > argocd/deployment/deployment.yml - - name: Commit Changes + + - name: ๐Ÿ’พ Commit Changes uses: EndBug/add-and-commit@v9 with: add: argocd/ author_name: "GitHub Action" author_email: gitia@siteworxpro.com - message: "Update deployment manifest with new image tags" + message: "Update deployment manifest with new image tags" \ No newline at end of file diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index 8cd05a5..f504703 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -7,56 +7,56 @@ name: Unit Tests jobs: build-javascript: - name: Run JavaScript Unit Tests + name: ๐Ÿงช JavaScript Tests runs-on: ubuntu-latest steps: - - name: Add Siteworx CA - run: | - apt update && apt install -yq ca-certificates curl - curl -Ls https://siteworxpro.com/hosted/Siteworx+Root+CA.pem -o /usr/local/share/ca-certificates/sw.crt - update-ca-certificates - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 1 - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: '22.14.0' - - name: Install dependencies - run: | - cd frontend - npm install - - name: Run tests - run: | - cd frontend - npm run build + - name: ๐Ÿ›ก Add Siteworx CA + run: | + apt update && apt install -yq ca-certificates curl + curl -Ls https://siteworxpro.com/hosted/Siteworx+Root+CA.pem -o /usr/local/share/ca-certificates/sw.crt + update-ca-certificates + - name: ๐Ÿ“– Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 1 + - name: โš™๏ธ Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '22.14.0' + - name: ๐Ÿ“ฆ Install dependencies + run: | + cd frontend + npm install + - name: โœ… Run tests + run: | + cd frontend + npm run build test-go: env: GOPRIVATE: 'git.siteworxpro.com' GOPROXY: 'direct' - name: Run Goland Unit Tests + name: ๐Ÿ” Go Tests runs-on: ubuntu-latest steps: - - name: Add Siteworx CA - run: | - apt update && apt install -yq ca-certificates curl - curl -Ls https://siteworxpro.com/hosted/Siteworx+Root+CA.pem -o /usr/local/share/ca-certificates/sw.crt - update-ca-certificates - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: '1.24.0' - cache: true - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 1 - - name: Install dependencies - run: | - cd backend - go mod download - - name: Run tests - run: | - cd backend - go test -v ./... -coverprofile=coverage.out + - name: ๐Ÿ›ก Add Siteworx CA + run: | + apt update && apt install -yq ca-certificates curl + curl -Ls https://siteworxpro.com/hosted/Siteworx+Root+CA.pem -o /usr/local/share/ca-certificates/sw.crt + update-ca-certificates + - name: โš™๏ธ Set up Go + uses: actions/setup-go@v2 + with: + go-version: '1.24.0' + cache: true + - name: ๐Ÿ“– Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 1 + - name: ๐Ÿ“ฆ Install dependencies + run: | + cd backend + go mod download + - name: โœ… Run tests + run: | + cd backend + go test -v ./... -coverprofile=coverage.out \ No newline at end of file