Skip to content

Commit 889dbd5

Browse files
committed
Try Github actions for bootstrap test
1 parent 60053ec commit 889dbd5

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed

.github/Dockerfile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM archlinux:base
2+
3+
RUN pacman -Syu --noconfirm \
4+
&& pacman -S --noconfirm fish yadm sudo
5+
6+
RUN useradd --create-home --shell /bin/bash --groups sudo primeapple
7+
USER primeapple
8+
9+
WORKDIR /home/primeapple
10+
COPY yadm-test.sh yadm-test.sh
11+
RUN chmod +x yadm-test.sh
12+
13+
CMD ./yadm-test.sh

.github/workflows/yadm-test.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Yadm Test
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
test:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v3
13+
14+
- name: Build Docker image
15+
run: docker build -f .github/Dockerfile -t arch-yadm .github/
16+
17+
- name: Run yadm-test script
18+
run: docker run --rm arch-yadm

.github/yadm-test.sh

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
echo "TEST: Cloning the dotfiles"
2+
yadm clone --no-bootstrap https://github.com/primeapple/dotfiles
3+
4+
pwd
5+
echo ~
6+
7+
echo "TEST: Checking if required directories and files exist"
8+
directories=("~/.config/nvim" "~/.config/fish")
9+
files=("~/.profile" "~/.vimrc")
10+
11+
for dir in "${directories[@]}"; do
12+
if [ ! -d "$dir" ]; then
13+
echo "Error: Directory $dir does not exist."
14+
exit 1
15+
fi
16+
done
17+
18+
for file in "${files[@]}"; do
19+
if [ ! -f "$file" ]; then
20+
echo "Error: File $file does not exist."
21+
exit 1
22+
fi
23+
done
24+
25+
echo "TEST: Executing bootstrap"
26+
yadm bootstrap

0 commit comments

Comments
 (0)