.github/workflows/main.yml
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Check-out repository under GitHub workspace
# https://github.com/actions/checkout
- uses: actions/checkout@v2
# Step's name
- name: Setup PHP
# Action gives to setup the PHP environment to test application
# https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v2
with:
# Specify the PHP version
php-version: '7.4.8'
- name: Install
# Install project
run: make install
- name: Run linter
run: make lint
# Publish code coverage on Code Climate
# https://github.com/paambaati/codeclimate-action
- name: Run Codeclimate test & publish code coverage
uses: paambaati/codeclimate-action@v2.6.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: make test-coverage
coverageLocations: ${{github.workplace}}/build/logs/clover.xml:clover
debug: true