feat: added initial CI #17
Workflow file for this run
This file contains hidden or 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
| name: Test on Pull Request and Push | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| test_status: ${{ steps.test-result.outcome }} | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v2 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| # Cache Alpine Base Images | |
| - name: Cache Docker Base Images | |
| id: cache-docker-images | |
| uses: actions/cache@v3 | |
| with: | |
| path: /tmp/.buildx-cache | |
| key: docker-base-images-${{ runner.os }}-${{ hashFiles('Dockerfile') }} | |
| restore-keys: | | |
| docker-base-images-${{ runner.os }}- | |
| # Pre-fetch Alpine Base Images | |
| - name: Preload Base Images | |
| if: steps.cache-docker-images.outputs.cache-hit != 'true' | |
| run: | | |
| docker pull alpine:3.19 | |
| docker pull alpine:3.20 | |
| docker pull alpine:3.21 | |
| docker pull alpine:latest | |
| - name: Install Docker Compose | |
| uses: docker/setup-buildx-action@v2 | |
| # Cache Docker Compose | |
| - name: Cache Docker Compose | |
| id: cache-compose | |
| uses: actions/cache@v3 | |
| with: | |
| path: /usr/local/bin/docker-compose | |
| key: compose-${{ runner.os }}-v2.19.1 | |
| - name: Install Docker Compose (if not cached) | |
| if: steps.cache-compose.outputs.cache-hit != 'true' | |
| run: | | |
| sudo curl -L "https://github.com/docker/compose/releases/download/v2.19.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
| sudo chmod +x /usr/local/bin/docker-compose | |
| - name: Create .env File | |
| run: | | |
| echo "Generating .env file..." | |
| cat <<EOF > .env | |
| DUCKDNSTOKEN=${{ secrets.DUCKDNSTOKEN }} | |
| CONFIG_ONLY_TEST_USER_PASS=${{ secrets.CONFIG_ONLY_TEST_USER_PASS }} | |
| CONFIG_ONLY_SSL_TEST_USER1_PASS=${{ secrets.CONFIG_ONLY_SSL_TEST_USER1_PASS }} | |
| CONFIG_ONLY_SSL_TEST_USER2_PASS=${{ secrets.CONFIG_ONLY_SSL_TEST_USER2_PASS }} | |
| ENV_OVERRIDE_TEST_USER1_PASS=${{ secrets.ENV_OVERRIDE_TEST_USER1_PASS }} | |
| ENV_OVERRIDE_TEST_USER2_PASS=${{ secrets.ENV_OVERRIDE_TEST_USER2_PASS }} | |
| ENV_OVERRIDE_SSL_TEST_USER1_PASS=${{ secrets.ENV_OVERRIDE_SSL_TEST_USER1_PASS }} | |
| ENV_OVERRIDE_SSL_TEST_USER2_PASS=${{ secrets.ENV_OVERRIDE_SSL_TEST_USER2_PASS }} | |
| EOF | |
| - name: Run Tests | |
| id: test-result | |
| env: | |
| LOG_LEVEL: ${{ vars.LOG_LEVEL }} | |
| run: | | |
| LOG_LEVEL=DEBUG bash tests/run-tests.sh |