name: Continuous integration on: pull_request: null push: branches: - main - develop - 2.x jobs: static-analysis: runs-on: ubuntu-22.04 strategy: matrix: php-version: ['8.1'] command: ['cs', 'stan', 'swagger:validate'] steps: - uses: actions/checkout@v3 - uses: './.github/actions/ci-setup' with: php-version: ${{ matrix.php-version }} php-extensions: openswoole-4.11.1 extensions-cache-key: tests-extensions-${{ matrix.php-version }}-${{ matrix.command }} - run: composer ${{ matrix.command }} unit-tests: uses: './.github/workflows/ci-tests.yml' with: test-group: unit api-tests: uses: './.github/workflows/ci-tests.yml' with: test-group: api cli-tests: uses: './.github/workflows/ci-tests.yml' with: test-group: cli sqlite-db-tests: uses: './.github/workflows/ci-db-tests.yml' with: platform: 'sqlite:ci' mysql-db-tests: uses: './.github/workflows/ci-db-tests.yml' with: platform: 'mysql' maria-db-tests: uses: './.github/workflows/ci-db-tests.yml' with: platform: 'maria' postgres-db-tests: uses: './.github/workflows/ci-db-tests.yml' with: platform: 'postgres' ms-db-tests: uses: './.github/workflows/ci-db-tests.yml' with: platform: 'ms' unit-mutation-tests: needs: - unit-tests uses: './.github/workflows/ci-mutation-tests.yml' with: test-group: unit db-mutation-tests: needs: - sqlite-db-tests uses: './.github/workflows/ci-mutation-tests.yml' with: test-group: db api-mutation-tests: needs: - api-tests uses: './.github/workflows/ci-mutation-tests.yml' with: test-group: api cli-mutation-tests: needs: - cli-tests uses: './.github/workflows/ci-mutation-tests.yml' with: test-group: cli upload-coverage: needs: - unit-tests - api-tests - cli-tests - sqlite-db-tests runs-on: ubuntu-22.04 strategy: matrix: php-version: ['8.1'] steps: - name: Checkout code uses: actions/checkout@v3 - name: Use PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} coverage: pcov ini-values: pcov.directory=module - uses: actions/download-artifact@v3 with: path: build - run: mv build/coverage-unit/coverage-unit.cov build/coverage-unit.cov - run: mv build/coverage-db/coverage-db.cov build/coverage-db.cov - run: mv build/coverage-api/coverage-api.cov build/coverage-api.cov - run: mv build/coverage-cli/coverage-cli.cov build/coverage-cli.cov - run: wget https://phar.phpunit.de/phpcov-8.2.1.phar - run: php phpcov-8.2.1.phar merge build --clover build/clover.xml - name: Publish coverage uses: codecov/codecov-action@v1 with: file: ./build/clover.xml delete-artifacts: needs: - unit-mutation-tests - db-mutation-tests - api-mutation-tests - cli-mutation-tests - upload-coverage runs-on: ubuntu-22.04 steps: - uses: geekyeggo/delete-artifact@v1 with: name: | coverage-unit coverage-db coverage-api coverage-cli build-docker-image: runs-on: ubuntu-22.04 steps: - name: Checkout code uses: actions/checkout@v3 with: fetch-depth: 100 - uses: marceloprado/has-changed-path@v1 id: changed-dockerfile with: paths: ./Dockerfile - if: ${{ steps.changed-dockerfile.outputs.changed == 'true' }} run: docker build -t shlink-docker-image:temp . - if: ${{ steps.changed-dockerfile.outputs.changed != 'true' }} run: echo "Dockerfile didn't change. Skipped"