From 395eae30ce404ce26c39813bfa3f9bd5276d0e66 Mon Sep 17 00:00:00 2001 From: Reza Behzadan Date: Tue, 6 Feb 2024 08:48:00 +0330 Subject: [PATCH] Add github actions for testing `setup.sh` --- .github/workflows/setup-test.yml | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/setup-test.yml diff --git a/.github/workflows/setup-test.yml b/.github/workflows/setup-test.yml new file mode 100644 index 0000000..5fea196 --- /dev/null +++ b/.github/workflows/setup-test.yml @@ -0,0 +1,34 @@ +name: Test Setup Script + +on: push + +jobs: + test-setup: + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v2 + + - name: Set up environment + run: | + sudo apt-get update + sudo apt-get install -y wget curl tar + + - name: Execute setup.sh + run: | + chmod +x setup.sh + ./setup.sh + env: + USER: ${{ github.actor }} + + - name: Verify directory creation + run: test -d /usr/local/share/GeoIP + + - name: Verify crontab entries + run: | + CRON_ENTRIES=$(crontab -l | grep -c 'geoip_updater.sh') + if [ "$CRON_ENTRIES" -ne 3 ]; then + echo "Expected 3 crontab entries for geoip_updater.sh, found $CRON_ENTRIES" + exit 1 + fi