2021-10-23 04:26:17 +13:00
|
|
|
name: "Tests"
|
|
|
|
on: [pull_request]
|
|
|
|
jobs:
|
|
|
|
tests:
|
|
|
|
name: Unit & E2E
|
2022-01-19 11:41:51 +13:00
|
|
|
runs-on: ubuntu-latest
|
2021-10-23 04:26:17 +13:00
|
|
|
|
|
|
|
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' }}
|
|
|
|
|
2022-01-19 11:41:51 +13:00
|
|
|
- name: Prepare Docker
|
2021-10-23 04:26:17 +13:00
|
|
|
run: |
|
2022-01-19 11:41:51 +13:00
|
|
|
export COMPOSE_INTERACTIVE_NO_CLI
|
|
|
|
export DOCKER_BUILDKIT=1
|
|
|
|
export COMPOSE_DOCKER_CLI_BUILD=1
|
2021-10-23 04:26:17 +13:00
|
|
|
echo "_APP_FUNCTIONS_RUNTIMES=php-8.0" >> .env
|
|
|
|
docker pull composer:2.0
|
|
|
|
docker pull php:8.0-cli-alpine
|
2022-01-19 11:41:51 +13:00
|
|
|
docker compose pull
|
|
|
|
|
2022-01-19 12:02:48 +13:00
|
|
|
- name: Prepare Cache
|
|
|
|
uses: satackey/action-docker-layer-caching@v0.0.11
|
2022-01-19 11:41:51 +13:00
|
|
|
# Ignore the failure of a step and avoid terminating the job.
|
|
|
|
continue-on-error: true
|
|
|
|
|
|
|
|
- name: Build Appwrite
|
2022-01-19 11:58:24 +13:00
|
|
|
run: docker compose build --progress=plain
|
2022-01-19 11:41:51 +13:00
|
|
|
|
|
|
|
- name: Start Appwrite
|
|
|
|
run: |
|
2021-10-23 04:32:25 +13:00
|
|
|
docker compose up -d
|
2022-01-04 01:44:28 +13:00
|
|
|
sleep 30
|
2022-01-19 11:41:51 +13:00
|
|
|
|
2021-10-23 04:26:17 +13:00
|
|
|
- name: Doctor
|
2021-10-23 04:32:25 +13:00
|
|
|
run: docker compose exec -T appwrite doctor
|
2021-10-23 04:26:17 +13:00
|
|
|
|
|
|
|
- name: Environment Variables
|
2021-10-23 04:32:25 +13:00
|
|
|
run: docker compose exec -T appwrite vars
|
2021-10-23 04:26:17 +13:00
|
|
|
|
|
|
|
- name: Run Tests
|
2021-10-23 05:30:42 +13:00
|
|
|
run: docker compose exec -T appwrite test --debug
|