Skip to content
Snippets Groups Projects
Commit 0f8f09b2 authored by Denis Urban's avatar Denis Urban
Browse files

add gh actions

parent a1776102
No related branches found
No related tags found
No related merge requests found
name: PHP CI
on:
push:
pull_request:
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
# - name: Configure sysctl limits
# run: |
# # sudo swapoff -a
# sudo sysctl -w vm.swappiness=1
# sudo sysctl -w fs.file-max=262144
# sudo sysctl -w vm.max_map_count=262144
# - name: Runs Elasticsearch
# uses: elastic/elastic-github-actions/elasticsearch@master
# with:
# stack-version: 8.9.0
- name: Install composer and dependencies
uses: php-actions/composer@v6
- name: PHPUnit Tests
uses: php-actions/phpunit@v3
env:
XDEBUG_MODE: coverage
with:
bootstrap: vendor/autoload.php
configuration: phpunit.xml.dist
php_extensions: xdebug
args: tests --coverage-clover ./coverage.xml
- name: Upload to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./coverage.xml
verbose: true
- name: Run PHP CodeSniffer
run: vendor/bin/phpcs -p --standard=PSR2 --ignore=vendor/ ./
\ No newline at end of file
sudo: false
language: php
php:
- 8.1
env:
global:
- ES_VERSION=8.9.0 ES_DOWNLOAD_URL=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}-linux-x86_64.tar.gz
install:
- wget ${ES_DOWNLOAD_URL}
- tar -xzf elasticsearch-${ES_VERSION}-linux-x86_64.tar.gz
- ./elasticsearch-${ES_VERSION}/bin/elasticsearch -d
before_script:
- if [ "$GITHUB_COMPOSER_AUTH" ]; then composer config -g github-oauth.github.com $GITHUB_COMPOSER_AUTH; fi
- composer install --no-interaction --prefer-dist
script:
- wget -q --waitretry=1 --retry-connrefused -T 10 -O - http://127.0.0.1:9200
- vendor/bin/phpunit --coverage-clover=coverage.xml
- vendor/bin/phpcs -p --standard=PSR2 --ignore=vendor/ ./
after_script:
- travis_retry bash <(curl -s https://codecov.io/bash)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment