Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
Merge branch 'develop' into feature/repository-update
Browse files Browse the repository at this point in the history
  • Loading branch information
perruche authored Jul 5, 2021
2 parents 0aac3b8 + 2cbc954 commit 070465c
Show file tree
Hide file tree
Showing 29 changed files with 575 additions and 130 deletions.
188 changes: 188 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
# This workflow will run tests using node and then publish
# a package to NPM Packages when a release is created.
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Tests

on:
push:
branches:
- master
- develop
pull_request:

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/

- name: Create test project
run: npm ci && node ./scripts/setup-test.js

- name: Create archive
run: tar -zcf __test-project__.tar.gz --directory=./__test-project__ .

- uses: actions/upload-artifact@v2
with:
name: test-project
path: ./__test-project__.tar.gz

phpcs:
name: PHPCS
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
# @todo PHP 8.0
php-versions: ['7.4']
composer-versions: ['v1', 'v2']
steps:
- uses: actions/download-artifact@v2
with:
name: test-project

- name: Extract archive
run: tar -xf __test-project__.tar.gz && ls -al

- name: Setup PHP, with composer and xdebug
uses: shivammathur/setup-php@v2 # https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
tools: composer:${{ matrix.composer-versions }}

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: PHPCS
run: composer run phpcs

phpstan:
name: PHPStan
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v2
with:
name: test-project

- name: Extract archive
run: tar -xf __test-project__.tar.gz && ls -al

- name: Setup PHP, with composer and xdebug
uses: shivammathur/setup-php@v2 # https://github.com/shivammathur/setup-php
with:
php-version: '7.3'
tools: composer:v2

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: PHPStan
run: composer run phpstan

eslint:
name: ESLint
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/

- uses: actions/download-artifact@v2
with:
name: test-project

- name: Extract archive
run: tar -xf __test-project__.tar.gz && ls -al

- run: npm run lint:scripts

stylelint:
name: Stylelint
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/

- uses: actions/download-artifact@v2
with:
name: test-project

- name: Extract archive
run: tar -xf __test-project__.tar.gz && ls -al

- run: npm run lint:styles

prettier:
name: Twig Prettier
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/

- uses: actions/download-artifact@v2
with:
name: test-project

- name: Extract archive
run: tar -xf __test-project__.tar.gz && ls -al

- run: npm run lint:templates

build-assets:
name: Build assets
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/

- uses: actions/download-artifact@v2
with:
name: test-project

- name: Extract archive
run: tar -xf __test-project__.tar.gz && ls -al

- run: npm run build
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@
node_modules/

# Template files
template/package-lock.json
template/package-lock.json

# Test files
/__test-project__/
Loading

0 comments on commit 070465c

Please sign in to comment.