mirror of
https://github.com/woodchen-ink/webp_server_go.git
synced 2025-07-18 13:42:02 +08:00
* Try using vips * No need libaom * Update code and version * update * Fix CI * Add sudo * Fix CI * Make CI happy * we happy few * Update README, fix CI * Add --no-install-recommends * Update code * Add ca-certificates for proxymode * Add pics/invalid.png for testing * Update README --------- Co-authored-by: Benny <benny.think@gmail.com>
94 lines
2.4 KiB
YAML
94 lines
2.4 KiB
YAML
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
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: '1.20'
|
|
|
|
- name: Setup necessary packages
|
|
run: |
|
|
sudo apt install libvips-dev -y
|
|
|
|
- name: run test cases
|
|
run: make test && make
|
|
|
|
- name: Codecov
|
|
uses: codecov/codecov-action@v2
|
|
with:
|
|
files: ./coverage.txt
|
|
verbose: true
|
|
|
|
image-test:
|
|
name: Check for image build and CVE
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- 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
|
|
uses: thollander/actions-comment-pull-request@v2
|
|
with:
|
|
message: |
|
|
```
|
|
${{ steps.trivy.outputs.stdout }}
|
|
```
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|