From e509ce4949cb94849fc407da59abddc53a5533d8 Mon Sep 17 00:00:00 2001 From: moslem-asaad Date: Wed, 5 Mar 2025 18:33:48 +0200 Subject: [PATCH] performance --- .github/workflows/build.yml | 49 +++++++++++++++++------------ .github/workflows/preproduction.yml | 9 +++--- 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bcc1767c54..90842a51aa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,30 +5,39 @@ on: branches: [ dev ] jobs: - lighthouse-tests: + build: runs-on: ubuntu-latest + steps: - - name: Checkout Code - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v3 - - name: Install Lighthouse CLI - run: npm install -g lighthouse + - name: Set up Go environment + uses: actions/setup-go@v3 + with: + go-version: '1.23.4' - - name: Run Lighthouse Performance Audit - run: | - mkdir -p reports - lighthouse https://fox-one-promptly.ngrok-free.app \ - --output=json \ - --output=html \ - --output-path=reports/lighthouse.html \ - --chrome-flags="--headless" + - name: Install dependencies + run: go mod download - - name: Debug - List Files - run: ls -alh reports + - name: Run unit tests + run: go test ./... -v + continue-on-error: true - - name: Upload Lighthouse Report - uses: actions/upload-artifact@v4 - with: - name: lighthouse-report - path: reports/lighthouse.report.html + - name: Run linting + run: | + go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest + golangci-lint run + - name: Build Docker image + run: | + docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/gitea:latest . + + - name: Log in to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Push Docker image + run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/gitea:latest diff --git a/.github/workflows/preproduction.yml b/.github/workflows/preproduction.yml index 3a74b32b72..e450a238b2 100644 --- a/.github/workflows/preproduction.yml +++ b/.github/workflows/preproduction.yml @@ -123,7 +123,7 @@ jobs: lighthouse-tests: runs-on: ubuntu-latest - needs: [api-tests, selenium-tests, notification-service-tests] + needs: [api-tests, selenium-tests, notification-service-tests] steps: - name: Checkout Code uses: actions/checkout@v4 @@ -133,20 +133,21 @@ jobs: - name: Run Lighthouse Performance Audit run: | + mkdir -p reports lighthouse https://fox-one-promptly.ngrok-free.app \ --output=json \ --output=html \ - --output-path=./lighthouse.html \ + --output-path=reports/lighthouse.html \ --chrome-flags="--headless" - name: Debug - List Files - run: ls -alh + run: ls -alh reports - name: Upload Lighthouse Report uses: actions/upload-artifact@v4 with: name: lighthouse-report - path: lighthouse-report.html + path: reports/lighthouse.report.html