From 8b1f3a145df48cfdc16d790379047c4801ee6e34 Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Sat, 15 Jan 2022 11:40:25 -0500 Subject: [PATCH 1/2] add check-aur.sh to check if the aur package works intended to be used in CI --- .gitignore | 1 + scripts/check-aur.sh | 15 +++++++++++++++ scripts/docker/arch/Dockerfile | 3 +++ scripts/docker/arch/install.sh | 5 +++++ 4 files changed, 24 insertions(+) create mode 100755 scripts/check-aur.sh create mode 100644 scripts/docker/arch/Dockerfile create mode 100755 scripts/docker/arch/install.sh diff --git a/.gitignore b/.gitignore index 585f96a..d20f73d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ SteamAuth/SteamAuth/packages/ test_maFiles/ *.deb +*.tar.gz target/ aur/ diff --git a/scripts/check-aur.sh b/scripts/check-aur.sh new file mode 100755 index 0000000..c0c0d6a --- /dev/null +++ b/scripts/check-aur.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Performs a test install of the package from the AUR. If the package fails to install, there should be a non-zero exit code. +# Intended for use with CI. + +set -e + +cd scripts/docker/arch/ +tar -cvf arch-docker.tar.gz . +docker image build -t steamguard-cli-archlinux-builder - < arch-docker.tar.gz +rm arch-docker.tar.gz + +docker run -it --rm steamguard-cli-archlinux-builder /bin/bash -c "./install.sh steamguard-cli-git && steamguard-cli --version" + +docker image rm steamguard-cli-archlinux-builder:latest diff --git a/scripts/docker/arch/Dockerfile b/scripts/docker/arch/Dockerfile new file mode 100644 index 0000000..2813c1e --- /dev/null +++ b/scripts/docker/arch/Dockerfile @@ -0,0 +1,3 @@ +FROM greyltc/archlinux-aur:yay + +COPY install.sh /install.sh diff --git a/scripts/docker/arch/install.sh b/scripts/docker/arch/install.sh new file mode 100755 index 0000000..f5585dd --- /dev/null +++ b/scripts/docker/arch/install.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +PACKAGE="$1" +echo "Installing $PACKAGE" +sudo -u ab -D~ bash -c "yay -Syu --removemake --needed --noprogressbar --noconfirm $PACKAGE" From dfdd9563c4878fd42eba14cf49458ba66ceba648 Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Sat, 15 Jan 2022 11:56:31 -0500 Subject: [PATCH 2/2] add aur install checker to CI, closes #102 --- .github/workflows/aur-checker.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/aur-checker.yml diff --git a/.github/workflows/aur-checker.yml b/.github/workflows/aur-checker.yml new file mode 100644 index 0000000..d0cc010 --- /dev/null +++ b/.github/workflows/aur-checker.yml @@ -0,0 +1,16 @@ +name: AUR install + +on: + schedule: + - cron: "32 5 */3 * *" + push: + branches: [ master, main ] + +jobs: + test-install: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install AUR package + run: ./scripts/check-aur.sh \ No newline at end of file