|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - '[0-9]+.[0-9]+.x' |
| 8 | + pull_request: |
| 9 | + types: [opened, synchronize, reopened] |
| 10 | + |
| 11 | +concurrency: |
| 12 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 13 | + cancel-in-progress: true |
| 14 | + |
| 15 | +permissions: {} |
| 16 | + |
| 17 | +defaults: |
| 18 | + run: |
| 19 | + shell: bash |
| 20 | + |
| 21 | +jobs: |
| 22 | + lint: |
| 23 | + runs-on: ubuntu-latest |
| 24 | + steps: |
| 25 | + - name: Initialize environment |
| 26 | + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@ef022a04090aca0945862f9f69f8ff3ea5865f26 |
| 27 | + - name: Setup ESLint Caching |
| 28 | + uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 |
| 29 | + with: |
| 30 | + path: .eslintcache |
| 31 | + key: ${{ runner.os }}-${{ hashFiles('.eslintrc.json') }} |
| 32 | + - name: Install node modules |
| 33 | + run: yarn install --frozen-lockfile --ignore-scripts |
| 34 | + - name: Run ESLint |
| 35 | + run: yarn lint --cache-strategy content |
| 36 | + - name: Validate NgBot Configuration |
| 37 | + run: yarn ng-dev ngbot verify |
| 38 | + - name: Validate Circular Dependencies |
| 39 | + run: yarn ts-circular-deps:check |
| 40 | + - name: Run Validation |
| 41 | + run: yarn -s admin validate |
| 42 | + - name: Check tooling setup |
| 43 | + run: yarn -s check-tooling-setup |
| 44 | + - name: Check commit message |
| 45 | + # Commit message validation is only done on pull requests as its too late to validate once |
| 46 | + # it has been merged. |
| 47 | + if: github.event_name == 'pull_request' |
| 48 | + run: yarn ng-dev commit-message validate-range ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} |
| 49 | + - name: Check code format |
| 50 | + # Code formatting checks are only done on pull requests as its too late to validate once |
| 51 | + # it has been merged. |
| 52 | + if: github.event_name == 'pull_request' |
| 53 | + run: yarn ng-dev format changed --check ${{ github.event.pull_request.base.sha }} |
0 commit comments