Update Composer packages (and commit lock file) #125
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: Run Tests | |
on: | |
# Trigger on push to the default branch | |
push: | |
branches: | |
- main | |
# Trigger the workflow on pull request events | |
# but only for the default branch | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-versions: | |
- '8.1' | |
- '8.2' | |
- '8.3' | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
tools: php-cs-fixer | |
- name: Get composer cache directory | |
id: composer-cache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
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 | |
- name: Install Node packages | |
run: sudo npm install -g eslint@8.57.0 | |
- name: Run JS linter (eslint) | |
run: eslint web/js | |
- name: Run PHP linter (php-cs-fixer) | |
run: PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer --diff --dry-run -v fix | |
- name: Atoum tests | |
run: | | |
cp app/config/config.ini-ghactions app/config/config.ini | |
vendor/atoum/atoum/bin/atoum -d tests/units/ --use-light-report | |
- name: Functional tests (API, pages) | |
run: | | |
php tests/functional/api.php | |
php tests/functional/pages.php |