From 9eea21e0c404a1f10f373f1c0bfcf3fbbabb1d89 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Mon, 16 Mar 2020 15:32:59 +0100 Subject: [PATCH] Add yarn matrix (#570) * Add yarn matrix * Update pr-any.yml --- .github/workflows/pr-any.yml | 50 +++++-------------------------- .github/workflows/push-master.yml | 31 +++++-------------- package.json | 2 ++ 3 files changed, 17 insertions(+), 66 deletions(-) diff --git a/.github/workflows/pr-any.yml b/.github/workflows/pr-any.yml index 88254f8b9..c7cb84c56 100644 --- a/.github/workflows/pr-any.yml +++ b/.github/workflows/pr-any.yml @@ -2,56 +2,20 @@ name: PR on: [pull_request] jobs: - lint: - name: Linting + pr: + strategy: + matrix: + step: ['lint', 'test', 'build', 'docs'] + name: ${{ matrix.step }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 with: node-version: '12.x' - - name: lint - run: | - yarn install --immutable | grep -v 'YN0013' - yarn lint - - test: - name: Testing - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1 - with: - node-version: '12.x' - - name: test + - name: ${{ matrix.step }} env: CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} run: | yarn install --immutable | grep -v 'YN0013' - yarn test - - build_code: - name: Build Code - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1 - with: - node-version: '12.x' - - name: build - run: | - yarn install --immutable | grep -v 'YN0013' - yarn build - - build_docs: - name: Build Docs - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1 - with: - node-version: '12.x' - - name: build - run: | - yarn install --immutable | grep -v 'YN0013' - yarn docs + yarn ${{ matrix.step }} diff --git a/.github/workflows/push-master.yml b/.github/workflows/push-master.yml index 46983c668..c43b2a3ec 100644 --- a/.github/workflows/push-master.yml +++ b/.github/workflows/push-master.yml @@ -5,8 +5,11 @@ on: - master jobs: - build_code: - name: Build Code + master: + strategy: + matrix: + step: ['build:release', 'docs:release'] + name: ${{ matrix.step }} if: "! contains(github.event.head_commit.message, '[CI Skip]')" runs-on: ubuntu-latest steps: @@ -16,35 +19,17 @@ jobs: - uses: actions/setup-node@v1 with: node-version: '12.x' - - name: build + - name: ${{ matrix.step }} env: CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + GH_PAGES_SRC: build-docs GH_PAT: ${{ secrets.GH_PAT }} GH_TOKEN: ${{ secrets.GH_PAT }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: | yarn install --immutable | grep -v 'YN0013' - yarn polkadot-ci-ghact-build - - build_docs: - name: Build Docs - if: "! contains(github.event.head_commit.message, '[CI Skip]')" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1 - with: - node-version: '12.x' - - name: build - env: - GH_PAT: ${{ secrets.GH_PAT }} - GH_TOKEN: ${{ secrets.GH_PAT }} - GH_PAGES_SRC: build-docs - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - yarn install --immutable | grep -v 'YN0013' - yarn polkadot-ci-ghact-docs + yarn ${{ matrix.step }} dummy: name: Dummy diff --git a/package.json b/package.json index dfe1aec94..c0b6fa6f6 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,9 @@ }, "scripts": { "build": "polkadot-dev-build-ts", + "build:release": "polkadot-ci-ghact-build", "docs": "polkadot-dev-build-docs", + "docs:release": "polkadot-ci-ghact-docs", "lint": "polkadot-dev-run-lint", "clean": "polkadot-dev-clean-build", "postinstall": "polkadot-dev-yarn-only",