Skip to content

Commit

Permalink
Try Github actions for bootstrap test
Browse files Browse the repository at this point in the history
  • Loading branch information
primeapple committed Nov 26, 2023
1 parent 60053ec commit cd454f5
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM archlinux:base

RUN pacman -Syu --noconfirm \
&& pacman -S --noconfirm fish yadm

WORKDIR /app
COPY yadm-test.sh yadm-test.sh
RUN chmod +x yadm-test.sh

CMD ./yadm-test.sh
20 changes: 20 additions & 0 deletions .github/workflows/yadm-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Yadm Test

on:
push:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Build Docker image
run: docker build -f .github/Dockerfile -t arch-yadm .github/

- name: Run yadm-test script
run: docker run --rm arch-yadm
26 changes: 26 additions & 0 deletions .github/yadm-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
echo "TEST: Cloning the dotfiles"
yadm clone --no-bootstrap https://github.com/primeapple/dotfiles

pwd
echo ~

echo "TEST: Checking if required directories and files exist"
directories=("~/.config/nvim" "~/.config/fish")
files=("~/.profile" "~/.vimrc")

for dir in "${directories[@]}"; do
if [ ! -d "$dir" ]; then
echo "Error: Directory $dir does not exist."
exit 1
fi
done

for file in "${files[@]}"; do
if [ ! -f "$file" ]; then
echo "Error: File $file does not exist."
exit 1
fi
done

echo "TEST: Executing bootstrap"
yadm bootstrap

0 comments on commit cd454f5

Please sign in to comment.