-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add installation test for OS and arch
- Loading branch information
1 parent
be65d24
commit 9e41977
Showing
8 changed files
with
207 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Test installation script | ||
|
||
on: | ||
push: | ||
branches: | ||
- "*" | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test-install: | ||
name: Test install.sh on various OS | ||
runs-on: "${{ matrix.os }}" | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-24.04 | ||
- ubuntu-22.04 | ||
- ubuntu-20.04 | ||
# - macos-14 # Docker install suported yet | ||
# - macos-13 | ||
- macos-12 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: (MacOS) Setup Docker | ||
if: startsWith(matrix.os, 'macos') | ||
# uses: docker-practice/actions-setup-docker@master | ||
# timeout-minutes: 12 | ||
uses: douglascamata/setup-docker-macos-action@main | ||
# uses: crazy-max/ghaction-setup-docker@v3 | ||
|
||
# Test the install script and cloudypad.sh for current commit | ||
- name: Run install script | ||
run: | | ||
curl -fsSL https://raw.githubusercontent.com/PierreBeucher/cloudypad/${{ github.sha }}/install.sh | CLOUDYPAD_VERSION=${{ github.sha }} sh | ||
- name: Check version | ||
run: | | ||
export PATH=$PATH:$HOME/.cloudypad/bin | ||
export CLOUDYPAD_CONTAINER_NO_TTY=true | ||
export CLOUDYPAD_CLI_LAUNCHER_DEBUG=true | ||
cloudypad --version | ||
test-install-container: | ||
name: Test install.sh on various OS in containers | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Test install.sh script | ||
run: test/shell/test-install.sh | ||
|
||
- name: Test cloudypad.sh script | ||
run: test/shell/test-cloudypad.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
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,11 @@ | ||
FROM alpine:3 | ||
|
||
# Install Docker client on Alpine | ||
RUN apk update && \ | ||
apk add --no-cache \ | ||
sudo \ | ||
curl \ | ||
openrc \ | ||
bash \ | ||
docker && \ | ||
rm -rf /var/cache/apk/* |
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,19 @@ | ||
FROM debian:bookworm | ||
|
||
# Install Docker as per https://docs.docker.com/desktop/install/debian/ | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
sudo \ | ||
apt-transport-https \ | ||
ca-certificates \ | ||
curl \ | ||
gnupg-agent \ | ||
software-properties-common && \ | ||
sudo install -m 0755 -d /etc/apt/keyrings && \ | ||
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc && \ | ||
sudo chmod a+r /etc/apt/keyrings/docker.asc && \ | ||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo \"$VERSION_CODENAME\") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \ | ||
sudo apt-get update && \ | ||
sudo apt-get install -y docker-ce-cli && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* |
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,17 @@ | ||
FROM ubuntu:22.04 | ||
|
||
# Install Docker as per https://docs.docker.com/engine/install/ubuntu/ | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
sudo \ | ||
apt-transport-https \ | ||
ca-certificates \ | ||
curl \ | ||
gnupg-agent \ | ||
software-properties-common && \ | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && \ | ||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \ | ||
apt-get update && \ | ||
apt-get install -y docker-ce-cli && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* |
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,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
echo "====================" | ||
echo "Testing Ubuntu" | ||
|
||
docker build -f test/shell/Dockerfile.ubuntu -t cloudypad-test-cli-ubuntu:local . | ||
docker run \ | ||
-v $PWD:/cloudypad -w /cloudypad \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
-it \ | ||
cloudypad-test-cli-ubuntu:local \ | ||
bash -c './cloudypad.sh --version' | ||
|
||
echo "====================" | ||
echo "Testing Debian" | ||
|
||
docker build -f test/shell/Dockerfile.debian -t cloudypad-test-cli-debian:local . | ||
docker run \ | ||
-v $PWD:/cloudypad -w /cloudypad \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
-it \ | ||
cloudypad-test-cli-debian:local \ | ||
bash -c './cloudypad.sh --version' | ||
|
||
echo "====================" | ||
echo "Testing Alpine" | ||
|
||
docker build -f test/shell/Dockerfile.alpine -t cloudypad-test-cli-alpine:local . | ||
docker run \ | ||
-v $PWD:/cloudypad -w /cloudypad \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
-it \ | ||
cloudypad-test-cli-alpine:local \ | ||
bash -c './cloudypad.sh --version' |
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,47 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
echo "Testing Ubuntu with bash" | ||
|
||
docker build -f test/shell/Dockerfile.ubuntu -t cloudypad-test-install-ubuntu:local . | ||
docker run \ | ||
-v $PWD:/cloudypad -w /cloudypad \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
-it \ | ||
cloudypad-test-install-ubuntu:local \ | ||
bash -e -i -c '/cloudypad/install.sh && source /root/.bashrc && echo $PATH && which cloudypad || (echo "Cloudypad not found on PATH after install" && false)' | ||
|
||
echo "====================" | ||
echo "Testing Ubuntu with sh" | ||
|
||
docker build -f test/shell/Dockerfile.ubuntu -t cloudypad-test-install-ubuntu:local . | ||
docker run \ | ||
-v $PWD:/cloudypad -w /cloudypad \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
-it \ | ||
cloudypad-test-install-ubuntu:local \ | ||
sh -c '/cloudypad/install.sh && PATH=$PATH:/root/.cloudypad/bin && echo $PATH && which cloudypad || (echo "Cloudypad not found on PATH after install" && false)' | ||
|
||
echo "====================" | ||
echo "Testing Debian with bash" | ||
|
||
docker build -f test/shell/Dockerfile.debian -t cloudypad-test-install-debian:local . | ||
docker run \ | ||
-v $PWD:/cloudypad -w /cloudypad \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
-it \ | ||
cloudypad-test-install-debian:local \ | ||
bash -i -c '/cloudypad/install.sh && source /root/.bashrc && echo $PATH && which cloudypad || (echo "Cloudypad not found on PATH after install" && false)' | ||
|
||
echo "====================" | ||
echo "Testing Alpine with sh" | ||
|
||
|
||
docker build -f test/shell/Dockerfile.alpine -t cloudypad-test-install-alpine:local . | ||
docker run \ | ||
-v $PWD:/cloudypad -w /cloudypad \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
-it \ | ||
cloudypad-test-install-alpine:local \ | ||
sh -c '/cloudypad/install.sh && PATH=$PATH:/root/.cloudypad/bin && echo $PATH && which cloudypad || (echo "Cloudypad not found on PATH after install" && false)' |