Browse Source

Separate CI flow into two parellel actions

pull/327/head
SteelWagstaff 4 years ago
parent
commit
8824cbfb9a
  1. 28
      .github/workflows/build-and-lint.yml
  2. 27
      .github/workflows/standards-and-tests.yml

28
.github/workflows/build-and-lint.yml

@ -0,0 +1,28 @@
on: push
name: Build & Lint
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '14' ]
name: Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v1
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Cache Node modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}
- name: Install Node dependencies & build assets
run: |
node -v
npm install
npm run build
- name: Run ESLint and Stylelint
run: npm run lint

27
.github/workflows/.pipeline.yml → .github/workflows/standards-and-tests.yml

@ -1,4 +1,4 @@
name: CI workflow
name: Run Standards & Tests
on:
push:
branches: [ dev, main ]
@ -32,11 +32,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Start required services
run: sudo systemctl start mysql.service
@ -46,12 +41,6 @@ jobs:
path: vendor
key: php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
- name: Cache node modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
@ -59,25 +48,11 @@ jobs:
tools: phpcs, composer:v1
coverage: pcov
- name: Install Node dependencies
run: |
node -v
npm install
if: matrix.experimental == false
- name: Install PHP dependencies
run: |
export PATH="$HOME/.composer/vendor/bin:$PATH"
composer install --no-interaction
- name: Run Lint
run: npm run lint
if: matrix.experimental == false
- name: Run Frontend Tests
run: npm run test
if: matrix.experimental == false
- name: Run PHP CodeSniffer
run: composer standards
Loading…
Cancel
Save