From e26d4d42469454e4926248142bb4b289acbcac81 Mon Sep 17 00:00:00 2001 From: Bishwajeet Parhi <62933155+2002Bishwajeet@users.noreply.github.com> Date: Wed, 2 Aug 2023 05:22:29 +0000 Subject: [PATCH 1/4] feat: test Workflow --- .github/workflows/test.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..a3d5240 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,25 @@ +name: "Tests" + +on: [pull_request] + + +jobs: + test: + name: "Unit & E2E Test" + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 2 + - name: Setup PHP Action + uses: shivammathur/setup-php@2.25.5 + with: + php-version: '8.0' + - name: Install dependencies + run: composer install --ignore-platform-reqs + - name: Run Tests + run: | + vendor/bin/phpunit --configuration phpunit.xml + vendor/bin/psalm --show-info=true + \ No newline at end of file From 3ca6296f9763da30ce54fd54cfe9d1956797c9a8 Mon Sep 17 00:00:00 2001 From: Bishwajeet Parhi <62933155+2002Bishwajeet@users.noreply.github.com> Date: Thu, 3 Aug 2023 04:52:16 +0000 Subject: [PATCH 2/4] chore: add test script and remove travis.yml --- .github/workflows/test.yml | 4 +--- .travis.yml | 16 ---------------- composer.json | 3 ++- 3 files changed, 3 insertions(+), 20 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a3d5240..f555e24 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,5 @@ jobs: - name: Install dependencies run: composer install --ignore-platform-reqs - name: Run Tests - run: | - vendor/bin/phpunit --configuration phpunit.xml - vendor/bin/psalm --show-info=true + run: composer test \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4b502c7..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: php - -php: -- 7.4 -- 8.0 -- nightly - -notifications: - email: - - team@appwrite.io - -before_script: composer install --ignore-platform-reqs - -script: -- vendor/bin/phpunit --configuration phpunit.xml -- vendor/bin/psalm --show-info=true diff --git a/composer.json b/composer.json index de010b7..34d8406 100755 --- a/composer.json +++ b/composer.json @@ -9,7 +9,8 @@ }, "scripts": { "lint": "./vendor/bin/pint --test", - "format": "./vendor/bin/pint" + "format": "./vendor/bin/pint", + "test": "vendor/bin/phpunit --configuration phpunit.xml" }, "require": { "php": ">=7.4" From 5da18bafb40574a28176d1c442985e2195b921cd Mon Sep 17 00:00:00 2001 From: Bishwajeet Parhi <62933155+2002Bishwajeet@users.noreply.github.com> Date: Mon, 14 Aug 2023 06:19:47 +0000 Subject: [PATCH 3/4] chore: use docker to run tests --- .github/workflows/test.yml | 10 +++------- composer.json | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f555e24..64277d6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,12 +12,8 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 2 - - name: Setup PHP Action - uses: shivammathur/setup-php@2.25.5 - with: - php-version: '8.0' - - name: Install dependencies - run: composer install --ignore-platform-reqs - name: Run Tests - run: composer test + run: | + docker run --rm --interactive -v $PWD:/app composer sh -c \ + "composer install --profile --ignore-platform-reqs && composer test" \ No newline at end of file diff --git a/composer.json b/composer.json index 34d8406..a6fcde0 100755 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ "scripts": { "lint": "./vendor/bin/pint --test", "format": "./vendor/bin/pint", - "test": "vendor/bin/phpunit --configuration phpunit.xml" + "test": "./vendor/bin/phpunit --configuration phpunit.xml" }, "require": { "php": ">=7.4" From 8b27f4223bb3d15a91c1573afc2b0e6a96eaa0c5 Mon Sep 17 00:00:00 2001 From: Bishwajeet Parhi <62933155+2002Bishwajeet@users.noreply.github.com> Date: Tue, 15 Aug 2023 04:05:47 +0000 Subject: [PATCH 4/4] chore: updates to workflow --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 64277d6..adfcfcf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,6 @@ name: "Tests" -on: [pull_request] +on: [pull_request,push] jobs: