Skip to content

Commit

Permalink
install libvips in ci runtime (#370)
Browse files Browse the repository at this point in the history
* install libvips in ci runtime

* Run CI on every PR

* CI test in Docker

* Update Dockerfile.CI
  • Loading branch information
n0vad3v authored Dec 29, 2024
1 parent 3831dbe commit 7429f67
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 35 deletions.
4 changes: 1 addition & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
.github/*
exhaust/*
pics/*
remote-raw/*
scripts/*
.git
.dockerignore
README.md
LICENSE
Makefile
LICENSE
41 changes: 9 additions & 32 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,14 @@
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
name: Check for image build, testing and CVE
runs-on: ubuntu-latest
permissions:
pull-requests: write
Expand All @@ -42,25 +21,23 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v2
- name: Make test
uses: docker/build-push-action@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
context: .
file: ./Dockerfile.CI
load: true
tags: |
ghcr.io/${{ github.event.repository.full_name }}:latest
- name: Build and load image
- name: Build image test
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 -
Expand Down
11 changes: 11 additions & 0 deletions Dockerfile.CI
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM golang:1.23-bookworm as builder

ARG IMG_PATH=/opt/pics
ARG EXHAUST_PATH=/opt/exhaust
RUN apt update && apt install --no-install-recommends libvips-dev -y && mkdir /build
COPY go.mod /build
RUN cd /build && go mod download

COPY . /build

RUN cd /build && make && make test

0 comments on commit 7429f67

Please sign in to comment.