Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install libvips in ci runtime #370

Merged
merged 4 commits into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading