From 034e7e3834a4e0a2f6e126d0e381a4c606ec377d Mon Sep 17 00:00:00 2001 From: wood Date: Thu, 5 Sep 2024 15:59:32 +0800 Subject: [PATCH] Bump github.com/valyala/fasthttp from 1.52.0 to 1.55.0 (#339) --- .github/workflows/CI.yaml | 90 --------------------- .github/workflows/codecov.yaml | 35 -------- .github/workflows/codeql-analysis.yml | 54 ------------- .github/workflows/integration-test.yaml | 78 ------------------ .github/workflows/release_binary.yaml | 51 ------------ .github/workflows/release_docker_image.yaml | 61 ++++---------- 6 files changed, 15 insertions(+), 354 deletions(-) delete mode 100644 .github/workflows/CI.yaml delete mode 100644 .github/workflows/codecov.yaml delete mode 100644 .github/workflows/codeql-analysis.yml delete mode 100644 .github/workflows/integration-test.yaml delete mode 100644 .github/workflows/release_binary.yaml diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml deleted file mode 100644 index 29b7423..0000000 --- a/.github/workflows/CI.yaml +++ /dev/null @@ -1,90 +0,0 @@ -name: CI check on every PR -on: - pull_request: - branches: - - master - paths-ignore: - - '**.md' - - 'Makefile' - - 'config.json' - -jobs: - ci: - name: CI check on every push and PR - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: '1.23' - - - name: Setup necessary packages - run: | - sudo apt update && sudo apt install libvips-dev -y - - - name: run test cases - run: make && make test - - image-test: - name: Check for image build and CVE - runs-on: ubuntu-latest - permissions: - pull-requests: write - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: true - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Build and load image - uses: docker/build-push-action@v3 - with: - context: . - load: true - tags: | - ghcr.io/${{ github.event.repository.full_name }}:latest - - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - - - name: Install trivy - run: | - wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add - - echo deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list.d/trivy.list - sudo apt-get update - sudo apt-get install trivy -y - - - name: Scan for CVE - uses: mathiasvr/command-output@v1 - id: trivy - with: - run: | - trivy image --no-progress --severity "HIGH,CRITICAL" --ignore-unfixed ghcr.io/${{ github.event.repository.full_name }} - - - name: Print CVE - run: | - echo "${{ steps.trivy.outputs.stdout }}" - - - name: Comment PR for CVE - uses: thollander/actions-comment-pull-request@v2 - with: - message: | - ``` - ${{ steps.trivy.outputs.stdout }} - ``` - comment_tag: cve - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/codecov.yaml b/.github/workflows/codecov.yaml deleted file mode 100644 index b30c1a4..0000000 --- a/.github/workflows/codecov.yaml +++ /dev/null @@ -1,35 +0,0 @@ -name: CI check on every push -on: - push: - paths-ignore: - - '**.md' - - 'Makefile' - - 'config.json' - branches: - - 'master' - -jobs: - ci: - name: CI check and codecov on every push - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: '1.23' - - - name: Setup necessary packages - run: | - sudo apt update && sudo apt install libvips-dev -y - - - name: run test cases - run: make && make test - - - name: Codecov - uses: codecov/codecov-action@v2 - with: - files: ./coverage.txt - verbose: true diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 2062add..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,54 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - schedule: - - cron: '32 20 * * 2' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'go' ] - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: '1.23' - - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml deleted file mode 100644 index 39af427..0000000 --- a/.github/workflows/integration-test.yaml +++ /dev/null @@ -1,78 +0,0 @@ -name: Integration Tests -on: - pull_request: - branches: - - master - paths-ignore: - - '**.md' - - 'Makefile' - - 'config.json' - -jobs: - glib_malloc: - name: Glib malloc RAM usage test - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install docker-compose - run: | - sudo apt-get update - sudo apt-get install -y docker-compose - - - name: Build image - uses: docker/build-push-action@v3 - with: - context: . - platforms: linux/amd64 - push: false - tags: ghcr.io/webp-sh/webp_server_go - - - name: Start the container - run: | - cp malloc_tests/glib_malloc/docker-compose.yml ./ - docker-compose up -d - - - name: Send Requests to Server - run: | - cd pics - find * -type f -print | xargs -I {} curl -o /dev/null -H "Accept: image/webp" http://localhost:3333/{} - - - name: Get container RAM stats - run: | - docker stats --no-stream - - jemalloc: - name: jemalloc RAM usage test - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install docker-compose - run: | - sudo apt-get update - sudo apt-get install -y docker-compose - - - name: Build image - uses: docker/build-push-action@v3 - with: - context: . - platforms: linux/amd64 - push: false - tags: ghcr.io/webp-sh/webp_server_go - - - name: Start the container - run: | - cp malloc_tests/jemalloc/docker-compose.yml ./ - docker-compose up -d - - - name: Send Requests to Server - run: | - cd pics - find * -type f -print | xargs -I {} curl -o /dev/null -H "Accept: image/webp" http://localhost:3333/{} - - - name: Get container RAM stats - run: | - docker stats --no-stream diff --git a/.github/workflows/release_binary.yaml b/.github/workflows/release_binary.yaml deleted file mode 100644 index 81425c0..0000000 --- a/.github/workflows/release_binary.yaml +++ /dev/null @@ -1,51 +0,0 @@ -name: Release Binaries - -on: - push: - paths-ignore: - - '**.md' - - 'Makefile' - - 'config.json' - tags: - - '*' - -jobs: - build: - name: Create Release - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Make WebP Server Go (amd64) - run: | - docker run --rm -w /app -v "$(pwd)":/app webpsh/libvips make - sudo chown -R $USER:$USER builds/ - sha256sum builds/webp-server-linux-amd64 > builds/webp-server-linux-amd64.sha256 - - - name: Make WebP Server Go (arm64) - run: | - docker run --rm -w /app -v "$(pwd)":/app --platform linux/arm64 webpsh/libvips make - sudo chown -R $USER:$USER builds/ - sha256sum builds/webp-server-linux-arm64 > builds/webp-server-linux-arm64.sha256 - - - name: Check for ldd version(AMD64 only) - run: | - ldd builds/webp-server-linux-amd64 - - - uses: "marvinpinto/action-automatic-releases@latest" - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - prerelease: true - title: "WebP Server Go" - files: | - builds/webp-server-linux-amd64 - builds/webp-server-linux-amd64.sha256 - builds/webp-server-linux-arm64 - builds/webp-server-linux-arm64.sha256 \ No newline at end of file diff --git a/.github/workflows/release_docker_image.yaml b/.github/workflows/release_docker_image.yaml index 34b7cf5..a8a77b0 100644 --- a/.github/workflows/release_docker_image.yaml +++ b/.github/workflows/release_docker_image.yaml @@ -1,4 +1,4 @@ -name: Build and release docker images +name: Build docker images on: push: paths-ignore: @@ -10,65 +10,34 @@ on: tags: - '*' +env: + IMAGE_NAME: webp-server-go + jobs: - docker: + build: runs-on: ubuntu-latest + steps: - name: Checkout uses: actions/checkout@v4 - with: - submodules: true - - name: Docker metadata - id: meta - uses: docker/metadata-action@v4 - with: - images: | - ghcr.io/${{ github.event.repository.full_name }} - webpsh/webp_server_go - webpsh/webp-server-go - webpsh/webps - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Cache Docker layers - uses: actions/cache@v2 + - name: Login to Docker Hub + uses: docker/login-action@v3 with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- + username: woodchen + password: ${{ secrets.ACCESS_TOKEN }} - - name: Build and push latest images - uses: docker/build-push-action@v3 + - name: Build and push + uses: docker/build-push-action@v5 with: context: . - platforms: linux/amd64,linux/arm64 + file: Dockerfile push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - - - name: Move cache - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache \ No newline at end of file + tags: woodchen/${{ env.IMAGE_NAME }}:latest + platforms: linux/amd64,linux/arm64