From 8824cbfb9a618acd89ff1c61c147dbcb8a0f2081 Mon Sep 17 00:00:00 2001 From: SteelWagstaff Date: Tue, 19 Apr 2022 21:12:37 -0700 Subject: [PATCH] Separate CI flow into two parellel actions --- .github/workflows/build-and-lint.yml | 28 +++++++++++++++++++ ...{.pipeline.yml => standards-and-tests.yml} | 27 +----------------- 2 files changed, 29 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/build-and-lint.yml rename .github/workflows/{.pipeline.yml => standards-and-tests.yml} (82%) diff --git a/.github/workflows/build-and-lint.yml b/.github/workflows/build-and-lint.yml new file mode 100644 index 0000000..09d4d93 --- /dev/null +++ b/.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 diff --git a/.github/workflows/.pipeline.yml b/.github/workflows/standards-and-tests.yml similarity index 82% rename from .github/workflows/.pipeline.yml rename to .github/workflows/standards-and-tests.yml index 288793b..17da9ec 100644 --- a/.github/workflows/.pipeline.yml +++ b/.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