From 6fd5df331687c9266be545a76dcc7975c0ba6d57 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Fri, 22 Oct 2021 17:26:17 +0200 Subject: [PATCH] add github action with selfhosted runner --- .github/workflows/tests.yml | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 000000000..fe11ff62f --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,39 @@ +name: "Tests" + +on: [pull_request] +jobs: + tests: + name: Unit & E2E + runs-on: self-hosted + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} + + - name: Build Appwrite + # Upstream bug causes buildkit pulls to fail so prefetch base images + # https://github.com/moby/moby/issues/41864 + run: | + echo "_APP_FUNCTIONS_RUNTIMES=php-8.0" >> .env + docker pull composer:2.0 + docker pull php:8.0-cli-alpine + docker-compose build + docker-compose up -d + sleep 10 + - name: Doctor + run: docker-compose exec -T appwrite doctor + + - name: Environment Variables + run: docker-compose exec -T appwrite vars + + - name: Run Tests + run: docker-compose exec -T appwrite test --debug \ No newline at end of file