chore(deps-dev): bump @commitlint/cli from 17.8.1 to 18.0.0 #32
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
paths: | |
- .github/workflows/test.yml | |
- src/* | |
- tests/* | |
env: | |
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | |
CC_TEST_REPORTER_URL: https://codeclimate.com/downloads/test-reporter/test-reporter-0.7.0-linux-amd64 | |
jobs: | |
test: | |
name: Runs on PHP ${{ matrix.php-versions }} | |
runs-on: ubuntu-20.04 | |
env: | |
GIT_COMMIT_SHA: ${{ github.sha }} | |
GIT_BRANCH: ${{ github.ref }} | |
strategy: | |
matrix: | |
php-versions: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Set up PHP | |
uses: shivammathur/setup-php@master | |
with: | |
php-version: ${{ matrix.php-versions }} | |
coverage: xdebug | |
- name: Get Composer cache directory | |
id: composer-cache | |
run: | | |
echo "GIT_BRANCH=$(echo ${GIT_BRANCH##*/} | tr / -)" >> $GITHUB_ENV | |
echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Cache Composer dependencies | |
uses: actions/cache@v1 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-progress --no-suggest | |
# https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables | |
# https://github.com/deivid-rodriguez/pry-byebug/blob/377e5b7d229a157bb896f21d776f71fc389a5c00/.github/workflows/ubuntu.yml#L46-L57 | |
- name: Set ENV for CodeClimate (pull_request) | |
if: github.event_name == 'pull_request' | |
run: echo "GIT_BRANCH=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV | |
- name: Spec | |
run: composer spec | |
- name: CodeClimate | |
env: | |
LCOV_REPORT: ${{ github.workspace }}/tests/lcov.info | |
CODECLIMATE_REPORT: ${{ github.workspace }}/tests/codeclimate.${{ matrix.php-versions }}.json | |
run: | | |
curl -LSs $CC_TEST_REPORTER_URL > ./cc-test-reporter && chmod +x ./cc-test-reporter | |
./cc-test-reporter format-coverage -t lcov -o $CODECLIMATE_REPORT $LCOV_REPORT | |
- name: Coveralls | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: tests/lcov.info | |
parallel: true | |
- name: Save Coverage Reports | |
uses: actions/upload-artifact@v2 | |
with: | |
name: test-reports | |
path: ${{ github.workspace }}/tests/*.json | |
reports: | |
name: Reports | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Reports | |
uses: actions/download-artifact@v2 | |
with: | |
name: test-reports | |
- name: Coveralls Report | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.github_token }} | |
path-to-lcov: tests/lcov.info | |
parallel-finished: true | |
- name: CodeClimate Report | |
run: | | |
curl -LSs $CC_TEST_REPORTER_URL > ./cc-test-reporter && chmod +x ./cc-test-reporter | |
./cc-test-reporter sum-coverage -o - codeclimate.*.json | ./cc-test-reporter upload-coverage --input - |