This repository has been archived by the owner on Sep 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/repository-update
- Loading branch information
Showing
29 changed files
with
575 additions
and
130 deletions.
There are no files selected for viewing
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
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 |
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
Oops, something went wrong.