Merge pull request #222 from splitio/task/flagsetsintoMF #157
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: ci | |
on: | |
push: | |
branches-ignore: | |
- none | |
pull_request: | |
branches-ignore: | |
- none | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
services: | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
strategy: | |
fail-fast: false | |
matrix: | |
version: | |
- '8.0' | |
- '8.1' | |
- '8.2' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.version }} | |
extensions: mbstring, intl | |
ini-values: post_max_size=256M, max_execution_time=180 | |
coverage: pcov | |
- name: Install dependencies | |
run: | | |
composer install --prefer-dist | |
composer update | |
- name: Build | |
run: | | |
vendor/bin/phpcs --ignore=functions.php --standard=PSR2 src/ | |
vendor/bin/phpunit -c phpunit.xml.dist -v --testsuite integration --coverage-clover coverage.xml | |
- name: Set VERSION env | |
run: echo "VERSION=$(cat src/SplitIO/Version.php | grep 'const CURRENT' | cut -d "'" -f 2 | sed "s/'//g")" >> $GITHUB_ENV | |
- name: SonarQube Scan (Push) | |
if: matrix.version == '8.2' && github.event_name == 'push' | |
uses: SonarSource/sonarcloud-github-action@v1.9 | |
env: | |
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
projectBaseDir: . | |
args: > | |
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} | |
- name: SonarQube Scan (Pull Request) | |
if: matrix.version == '8.2' && github.event_name == 'pull_request' | |
uses: SonarSource/sonarcloud-github-action@v1.9 | |
env: | |
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
projectBaseDir: . | |
args: > | |
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} | |
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }} | |
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }} | |
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }} |