-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try Github actions for bootstrap test
- Loading branch information
1 parent
60053ec
commit 3f41e0c
Showing
5 changed files
with
100 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM archlinux:base | ||
|
||
RUN pacman -Syu --noconfirm \ | ||
&& pacman -S --noconfirm fish yadm | ||
|
||
RUN useradd --create-home --shell /bin/bash primeapple | ||
|
||
WORKDIR /home/primeapple | ||
COPY yadm-test.sh yadm-test.sh | ||
RUN chmod +x yadm-test.sh && chown primeapple:primeapple yadm-test.sh | ||
|
||
USER primeapple | ||
CMD ./yadm-test.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Yadm Test | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
yadm-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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
echo "## TEST: Cloning the dotfiles via YADM ##" | ||
yadm clone --no-bootstrap https://github.com/primeapple/dotfiles | ||
echo '## DONE' | ||
|
||
############################################################################### | ||
|
||
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 '## DONE' | ||
|
||
############################################################################### | ||
|
||
echo "##TEST: Executing bootstrap" | ||
yadm bootstrap | ||
echo '## DONE' | ||
|
||
############################################################################### | ||
|
||
echo "##TEST: README.md and LICENSE and .github/ should not be checked out" | ||
if [ -f "README.md" ]; then | ||
echo "Error: README.md should not be checked out." | ||
exit 1 | ||
fi | ||
|
||
if [ -f "LICENSE" ]; then | ||
echo "Error: LICENSE should not be checked out." | ||
exit 1 | ||
fi | ||
|
||
if [ -d ".github" ]; then | ||
echo "Error: .github/ should not be checked out." | ||
exit 1 | ||
fi | ||
echo '## DONE' | ||
|
||
############################################################################### | ||
|
||
echo "##TEST: fish is the default shell" | ||
if [ "$(basename "$SHELL")" != "fish" ]; then | ||
echo "Error: fish is not the default shell." | ||
exit 1 | ||
fi | ||
echo '## DONE' | ||
|
||
############################################################################### | ||
|
||
echo "##TEST: fisher is installed" | ||
if ! fish -c "fisher --version" >/dev/null 2>&1; then | ||
echo "Error: fisher is not installed." | ||
exit 1 | ||
fi |