docs: clean up readme #126
This file contains hidden or 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
| name: '@nxworker CI pipeline' | |
| env: | |
| BASE_BRANCH: ${{ github.event.pull_request.base.ref }} | |
| NODE_OPTIONS: --max_old_space_size=6144 | |
| node-version: 14.x | |
| NX_BRANCH: ${{ github.event.number }} | |
| NX_RUN_GROUP: ${{ github.run_id }} | |
| PNPM_STORE_PATH: ~/.pnpm-store | |
| PNPM_VERSION: 5.x | |
| is-feature-branch: | |
| ${{ github.ref != 'refs/heads/$BASE_BRANCH' && (github.event_name == | |
| 'pull_request' || github.event_name == 'workflow_dispatch') }} | |
| is-main-branch: | |
| ${{ github.ref == 'refs/heads/main' && (github.event_name == 'push' || | |
| github.event_name == 'workflow_dispatch') }} | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: {} | |
| workflow_dispatch: {} | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - if: ${{ env.is-main-branch }} | |
| uses: actions/checkout@v2 | |
| # needed for nx affected command | |
| - if: ${{ env.is-feature-branch }} | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| # needed for nx affected command | |
| - if: ${{ env.is-feature-branch }} | |
| run: git fetch --no-tags --depth=1 origin $BASE_BRANCH | |
| - name: Use Node.js ${{ env.node-version }} | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: ${{ env.node-version }} | |
| - run: npm install --global pnpm@$PNPM_VERSION | |
| - run: pnpm config set store-dir $PNPM_STORE_PATH | |
| - name: Cache PNPM store | |
| uses: actions/cache@v2 | |
| with: | |
| path: ${{ env.PNPM_STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm- | |
| - run: pnpm install | |
| - run: pnpm store prune | |
| - if: ${{ env.is-main-branch }} | |
| run: pnpm lint -- --max-parallel=2 | |
| - if: ${{ env.is-feature-branch }} | |
| run: pnpm affected:lint -- --base=origin/$BASE_BRANCH --max-parallel=2 | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - if: ${{ env.is-main-branch }} | |
| uses: actions/checkout@v2 | |
| # needed for nx affected command | |
| - if: ${{ env.is-feature-branch }} | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| # needed for nx affected command | |
| - if: ${{ env.is-feature-branch }} | |
| run: git fetch --no-tags --depth=1 origin $BASE_BRANCH | |
| - name: Use Node.js ${{ env.node-version }} | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: ${{ env.node-version }} | |
| - run: npm install --global pnpm@$PNPM_VERSION | |
| - run: pnpm config set store-dir $PNPM_STORE_PATH | |
| - name: Cache PNPM store | |
| uses: actions/cache@v2 | |
| with: | |
| path: ${{ env.PNPM_STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm- | |
| - run: pnpm install | |
| - run: pnpm store prune | |
| - if: ${{ env.is-main-branch }} | |
| run: pnpm test -- --max-parallel=2 | |
| - if: ${{ env.is-feature-branch }} | |
| run: pnpm affected:test -- --base=origin/$BASE_BRANCH --max-parallel=2 | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - if: ${{ env.is-main-branch }} | |
| uses: actions/checkout@v2 | |
| # needed for nx affected command | |
| - if: ${{ env.is-feature-branch }} | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| # needed for nx affected command | |
| - if: ${{ env.is-feature-branch }} | |
| run: git fetch --no-tags --depth=1 origin $BASE_BRANCH | |
| - name: Use Node.js ${{ env.node-version }} | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: ${{ env.node-version }} | |
| - run: npm install --global pnpm@$PNPM_VERSION | |
| - run: pnpm config set store-dir $PNPM_STORE_PATH | |
| - name: Cache PNPM store | |
| uses: actions/cache@v2 | |
| with: | |
| path: ${{ env.PNPM_STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm- | |
| - run: pnpm install | |
| - run: pnpm store prune | |
| - if: ${{ env.is-main-branch }} | |
| run: pnpm build | |
| - if: ${{ env.is-feature-branch }} | |
| run: pnpm affected:build -- --base=origin/$BASE_BRANCH | |
| - uses: actions/upload-artifact@v2 | |
| with: | |
| name: angular-package | |
| path: dist/packages/angular | |
| if-no-files-found: warn | |
| e2e: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Use Node.js ${{ env.node-version }} | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: ${{ env.node-version }} | |
| - run: npm install --global pnpm@$PNPM_VERSION | |
| - run: pnpm config set store-dir $PNPM_STORE_PATH | |
| - name: Cache PNPM store | |
| uses: actions/cache@v2 | |
| with: | |
| path: ${{ env.PNPM_STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm- | |
| - run: pnpm install | |
| - run: pnpm store prune | |
| - run: pnpm e2e |