Skip to content
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
30 changes: 30 additions & 0 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: PR Test

on:
pull_request:
branches:
- master
- main

jobs:
test:
strategy:
matrix:
distro:
- alpine
- archlinux
- fedora
- ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Only build
run: |
docker buildx build --platform linux/amd64 --output "type=image,push=false" -f tests/Dockerfile-${{ matrix.distro }} .
10 changes: 7 additions & 3 deletions install-scripts/01-install-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ PACKAGES=(
"curl"
"bat"
"go"
"npm"
"ripgrep"
"exa"
)

# if MacOS install Homebrew
Expand All @@ -26,7 +24,7 @@ fi
# if Arch install
if [ -f /etc/arch-release ]; then
# install yay
if [ -z $(which yay) ]; then
if [ -z "$(which yay)" ] && [ "$EUID" -ne 0 ]; then
sudo pacman -S --noconfirm base-devel
git clone https://aur.archlinux.org/yay.git
cd yay
Expand Down Expand Up @@ -61,3 +59,9 @@ if [ "$(uname)" == "FreeBSD" ]; then
# install packages
sudo pkg install -y "${PACKAGES[@]}"
fi

# if RHEL/CentOS/Fedora install
if [ -f /etc/redhat-release ]; then
# install packages
sudo dnf install -y "${PACKAGES[@]}"
fi
9 changes: 9 additions & 0 deletions tests/Dockerfile-alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM alpine:latest

COPY . /workspace

WORKDIR /workspace

RUN apk add make shadow bash sudo

RUN make
10 changes: 10 additions & 0 deletions tests/Dockerfile-archlinux
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM archlinux:latest

COPY ../. /workspace

WORKDIR /workspace

RUN pacman -Syy
RUN pacman -S --noconfirm make sudo git which

RUN make
10 changes: 10 additions & 0 deletions tests/Dockerfile-fedora
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM fedora:latest

COPY ../. /workspace

WORKDIR /workspace

RUN dnf -y update
RUN dnf -y install make sudo

RUN make
9 changes: 9 additions & 0 deletions tests/Dockerfile-ubuntu
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM ubuntu:latest

COPY ../. /workspace

WORKDIR /workspace

RUN apt install --update -y make sudo

RUN make