From 5d79ae6ee29c310a8100a154a7efee0a3df5ff05 Mon Sep 17 00:00:00 2001 From: Bishwajeet Parhi <62933155+2002Bishwajeet@users.noreply.github.com> Date: Fri, 4 Aug 2023 15:15:48 +0000 Subject: [PATCH 1/5] feat: Tests workflow --- .github/workflows/test.yml | 27 +++++++++++++++++++++++++++ composer.json | 4 +++- 2 files changed, 30 insertions(+), 1 deletion(-) 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..b6a23ac --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,27 @@ +name: "Tests" + +on: [pull_request] + + +jobs: + test: + name: "Unit & E2E Test" + runs-on: ubuntu-latest + strategy: + matrix: + php-versions: ['7.0', '8.0', '8.0.23','nightly'] + 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: ${{matrix.php-versions}} + - name: Install dependencies + run: composer install --ignore-platform-reqs + - name: Analyse code + run: composer analyse + - name: Run Tests + run: composer test diff --git a/composer.json b/composer.json index 13b46be..4553f0b 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,9 @@ }, "scripts": { "lint": "./vendor/bin/pint --test", - "format": "./vendor/bin/pint" + "format": "./vendor/bin/pint", + "test": "vendor/bin/phpunit --configuration phpunit.xml --testsuite General", + "analyse": "vendor/bin/psalm --show-info=true" }, "require": { "php": ">=7.4", From 804a8c5a27bec35d5f1f2117e35c31f8cb95a53f Mon Sep 17 00:00:00 2001 From: Bishwajeet Parhi <62933155+2002Bishwajeet@users.noreply.github.com> Date: Fri, 4 Aug 2023 15:20:47 +0000 Subject: [PATCH 2/5] remove travis.yml --- .travis.yml | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 912d3d6..0000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: php - -dist: xenial - -arch: -- amd64 -- arm64 - -php: -- 7.4 -- 8.0 -- 8.0.23 - -before_install: - - git clone https://github.com/P-H-C/phc-winner-argon2.git libargon2 && cd libargon2 && make test && sudo make install PREFIX=/usr && cd .. - -notifications: - email: - - team@appwrite.io - -before_script: composer install --ignore-platform-reqs - -script: -- vendor/bin/phpunit --configuration phpunit.xml --testsuite General -- vendor/bin/psalm --show-info=true -- if [ "$TRAVIS_CPU_ARCH" = "amd64" ]; then vendor/bin/phpunit --configuration phpunit.xml --testsuite X86; fi -- if [ "$TRAVIS_CPU_ARCH" = "arm64" ]; then vendor/bin/phpunit --configuration phpunit.xml --testsuite ARM; fi From cbc6356757030487ea63f0904613ce21dd9e2e50 Mon Sep 17 00:00:00 2001 From: Bishwajeet Parhi <62933155+2002Bishwajeet@users.noreply.github.com> Date: Tue, 8 Aug 2023 17:58:23 +0000 Subject: [PATCH 3/5] update php version matrix to be run on --- .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 b6a23ac..74ea7ff 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: ['7.0', '8.0', '8.0.23','nightly'] + php-versions: ['7.4', '8.0','nightly'] steps: - name: Checkout repository uses: actions/checkout@v3 From 48cc6c70db43761689a825a2a4e21fec8510999c Mon Sep 17 00:00:00 2001 From: Bishwajeet Parhi <62933155+2002Bishwajeet@users.noreply.github.com> Date: Mon, 14 Aug 2023 06:24:23 +0000 Subject: [PATCH 4/5] chore: use docker to run tests --- .github/workflows/test.yml | 12 +++--------- composer.json | 4 ++-- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 74ea7ff..5bbfcf8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,13 +15,7 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 2 - - name: Setup PHP Action - uses: shivammathur/setup-php@2.25.5 - with: - php-version: ${{matrix.php-versions}} - - name: Install dependencies - run: composer install --ignore-platform-reqs - - name: Analyse code - run: composer analyse - 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" diff --git a/composer.json b/composer.json index b48d8ef..74de65a 100644 --- a/composer.json +++ b/composer.json @@ -21,8 +21,8 @@ "scripts": { "lint": "./vendor/bin/pint --test", "format": "./vendor/bin/pint", - "test": "vendor/bin/phpunit --configuration phpunit.xml --testsuite General", - "analyse": "vendor/bin/psalm --show-info=true" + "test": "./vendor/bin/phpunit --configuration phpunit.xml --testsuite General", + "analyse": "./vendor/bin/psalm --show-info=true" }, "require": { "php": ">=8.0.0", From a144ec7882f610ce7bd90e11a3e0302fc776ddbe Mon Sep 17 00:00:00 2001 From: Bishwajeet Parhi <62933155+2002Bishwajeet@users.noreply.github.com> Date: Tue, 15 Aug 2023 04:05:17 +0000 Subject: [PATCH 5/5] chore: updates to workflow --- .github/workflows/test.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5bbfcf8..5a34744 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,15 +1,12 @@ name: "Tests" -on: [pull_request] +on: [pull_request, push] jobs: test: name: "Unit & E2E Test" runs-on: ubuntu-latest - strategy: - matrix: - php-versions: ['7.4', '8.0','nightly'] steps: - name: Checkout repository uses: actions/checkout@v3