From 0c89bc51e26a5c47e1a3fb5e24e9fcadc4e444f4 Mon Sep 17 00:00:00 2001 From: Minh Vuong Date: Mon, 18 Mar 2024 17:32:32 +0700 Subject: [PATCH] ci: add workflow --- .github/workflows/unit_tests.yml | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/unit_tests.yml diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml new file mode 100644 index 0000000..90da428 --- /dev/null +++ b/.github/workflows/unit_tests.yml @@ -0,0 +1,38 @@ +name: Unit Tests + +on: + push: + branches: + - main + pull_request: ~ + +jobs: + unit_tests: + strategy: + matrix: + php: + - '8.2' + - '8.3' + + runs-on: ubuntu-latest + + name: "PHP ${{ matrix.php }} tests" + + steps: + - uses: actions/checkout@v4 + + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: pcov + + - uses: "ramsey/composer-install@v2" + + - run: ./vendor/bin/phpunit + + - uses: codecov/codecov-action@v2 + with: + name: "phpunit-php${{ matrix.php }}" + flags: phpunit + fail_ci_if_error: true + continue-on-error: true