From: gggeek Date: Thu, 24 Nov 2022 17:15:13 +0000 (+0000) Subject: use two versions of ubuntu to run CI tests X-Git-Tag: 4.9.0~27 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=21feea6f679380816337aa1931ec7b3e910aff54;p=plcapi.git use two versions of ubuntu to run CI tests --- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d464bfe..c19c9e5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,11 +21,30 @@ jobs: strategy: fail-fast: false matrix: - # @see https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners - operating-system: ['ubuntu-20.04'] # @todo add 'windows-latest'. Also: run some tests on ubuntu 22 - # @todo enable testing on php 5.3. Note that it requires use an older version of phpunit (and there is - # no yoast/phpunit-polyfills support?) - php: ['8.1', '8.0', '7.4', '7.3', '7.2', '7.1', '7.0', '5.6', '5.5', '5.4'] + include: + # @see https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners + # @todo run some tests on 'windows-latest' (needs test env setup scripts for windows to be developed) + - php: '8.1' + operating-system: ubuntu-22.04 + code-coverage: true + - php: '8.0' + operating-system: ubuntu-22.04 + - php: '7.4' + operating-system: ubuntu-22.04 + - php: '7.3' + operating-system: ubuntu-22.04 + - php: '7.2' + operating-system: ubuntu-20.04 + - php: '7.1' + operating-system: ubuntu-20.04 + - php: '7.0' + operating-system: ubuntu-20.04 + - php: '5.6' + operating-system: ubuntu-20.04 + - php: '5.5' + operating-system: ubuntu-22.04 + - php: '5.4' + operating-system: ubuntu-20.04 steps: - name: checkout code uses: actions/checkout@v3 @@ -66,16 +85,19 @@ jobs: - name: install dependencies run: 'composer install' - - name: run tests and upload coverage info - if: ${{ matrix.php == '7.4' }} + - name: run tests and upload coverage info if needed run: | - ./tests/ci/setup/setup_code_coverage.sh enable - ./vendor/bin/phpunit -v --coverage-clover=coverage.clover tests - if [ -f coverage.clover ]; then wget https://uploader.codecov.io/latest/linux/codecov && chmod +x codecov && ./codecov -f coverage.clover; fi - - - name: run tests - if: ${{ matrix.php != '7.4' }} - run: './vendor/bin/phpunit -v tests' + if [ "${{ matrix.code-coverage }}" != true ]; then + ./vendor/bin/phpunit -v tests + else + ./tests/ci/setup/setup_code_coverage.sh enable + ./vendor/bin/phpunit -v --coverage-clover=coverage.clover tests + if [ -f coverage.clover ]; then + wget https://uploader.codecov.io/latest/linux/codecov && \ + chmod +x codecov && \ + ./codecov -f coverage.clover + fi + fi # @todo would it be useful to run a 2nd test with composer --prefer-lowest? After all the only dependencies we have are testing tools