diff --git a/.github/workflows/block-build.yml b/.github/workflows/block-build.yml index 83d81229c84..de61e9564b0 100644 --- a/.github/workflows/block-build.yml +++ b/.github/workflows/block-build.yml @@ -24,23 +24,11 @@ jobs: strategy: matrix: node-version: [18] + needs: build-monorepo steps: - - uses: actions/checkout@v4 + - name: 'Cache build' + - uses: 'actions/cache@v3' with: - submodules: recursive - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - - run: npm ci --omit=peer - working-directory: ${{github.workspace}} - - - run: npm run lint - - run: npm run coverage - - uses: codecov/codecov-action@v3 - with: - files: ${{ env.cwd }}/coverage/lcov.info - flags: block + path: '.' + key: '${{ runner.os }}-node-18-${{ git rev-parse HEAD }}' + restore-keys: '${{ runner.os }}-node-18' \ No newline at end of file diff --git a/.github/workflows/build-monorepo-pr.yml b/.github/workflows/build-monorepo-pr.yml new file mode 100644 index 00000000000..39b5e9769c9 --- /dev/null +++ b/.github/workflows/build-monorepo-pr.yml @@ -0,0 +1,39 @@ +name: Block +on: + push: + branches: [master, develop] + tags: ['*'] + pull_request: + types: [opened, reopened, synchronize] + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + build-monorepo: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18] + steps: + - name: Checkout monorepo + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Setup node + - uses: actions/setup-node@v4 + with: + node-version: 18 + cache: 'npm' + + - name: 'Cache build' + - uses: 'actions/cache@v3' + with: + path: '.' + key: '${{ runner.os }}-node-18-${{ git rev-parse HEAD }}' + restore-keys: '${{ runner.os }}-node-18' + + - run: npm i \ No newline at end of file