Skip to content

Commit 56b0da7

Browse files
committed
add pr-check to verify things work on all distros
1 parent 0c8a75c commit 56b0da7

File tree

6 files changed

+78
-3
lines changed

6 files changed

+78
-3
lines changed

.github/workflows/pr-test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: PR Test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- main
8+
push:
9+
branches:
10+
- pr-checks
11+
12+
jobs:
13+
test:
14+
strategy:
15+
matrix:
16+
distro:
17+
- alpine
18+
- archlinux
19+
- fedora
20+
- ubuntu
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v3
24+
25+
- name: Set up QEMU
26+
uses: docker/setup-qemu-action@v3
27+
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v3
30+
31+
- name: Only build
32+
run: |
33+
docker buildx build --platform linux/amd64 --output "type=image,push=false" -f tests/Dockerfile-${{ matrix.distro }} .

install-scripts/01-install-packages.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ PACKAGES=(
99
"curl"
1010
"bat"
1111
"go"
12-
"npm"
1312
"ripgrep"
14-
"exa"
1513
)
1614

1715
# if MacOS install Homebrew
@@ -26,7 +24,7 @@ fi
2624
# if Arch install
2725
if [ -f /etc/arch-release ]; then
2826
# install yay
29-
if [ -z $(which yay) ]; then
27+
if [ -z "$(which yay)" ] && [ "$EUID" -ne 0 ]; then
3028
sudo pacman -S --noconfirm base-devel
3129
git clone https://aur.archlinux.org/yay.git
3230
cd yay
@@ -61,3 +59,9 @@ if [ "$(uname)" == "FreeBSD" ]; then
6159
# install packages
6260
sudo pkg install -y "${PACKAGES[@]}"
6361
fi
62+
63+
# if RHEL/CentOS/Fedora install
64+
if [ -f /etc/redhat-release ]; then
65+
# install packages
66+
sudo dnf install -y "${PACKAGES[@]}"
67+
fi

tests/Dockerfile-alpine

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM alpine:latest
2+
3+
COPY . /workspace
4+
5+
WORKDIR /workspace
6+
7+
RUN apk add make shadow bash sudo
8+
9+
RUN make

tests/Dockerfile-archlinux

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM archlinux:latest
2+
3+
COPY ../. /workspace
4+
5+
WORKDIR /workspace
6+
7+
RUN pacman -Syy
8+
RUN pacman -S --noconfirm make sudo git which
9+
10+
RUN make

tests/Dockerfile-fedora

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM fedora:latest
2+
3+
COPY ../. /workspace
4+
5+
WORKDIR /workspace
6+
7+
RUN dnf -y update
8+
RUN dnf -y install make sudo
9+
10+
RUN make

tests/Dockerfile-ubuntu

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM ubuntu:latest
2+
3+
COPY ../. /workspace
4+
5+
WORKDIR /workspace
6+
7+
RUN apt install --update -y make sudo
8+
9+
RUN make

0 commit comments

Comments
 (0)