|
| 1 | +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json |
| 2 | + |
| 3 | +name: Build |
| 4 | + |
| 5 | +on: |
| 6 | + pull_request: |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + - next |
| 11 | + - alpha |
| 12 | + - beta |
| 13 | + |
| 14 | +jobs: |
| 15 | + deduplicate: |
| 16 | + name: Deduplicate Jobs |
| 17 | + runs-on: ubuntu-latest |
| 18 | + outputs: |
| 19 | + should_skip: ${{ steps.skip_check.outputs.should_skip }} |
| 20 | + steps: |
| 21 | + - id: skip_check |
| 22 | + uses: fkirc/skip-duplicate-actions@master |
| 23 | + with: |
| 24 | + concurrent_skipping: same_content_newer |
| 25 | + |
| 26 | + build: |
| 27 | + name: Build + Test + Release / Node ${{ matrix.node }} |
| 28 | + runs-on: ubuntu-latest |
| 29 | + if: ${{ needs.deduplicate.outputs.should_skip != 'true' }} |
| 30 | + strategy: |
| 31 | + matrix: |
| 32 | + node: ['12', '14', '16'] |
| 33 | + playwright: ['1.1.0', 'latest'] |
| 34 | + |
| 35 | + steps: |
| 36 | + - name: Get Yarn cache path |
| 37 | + id: yarn-cache |
| 38 | + run: echo "::set-output name=dir::$(yarn cache dir)" |
| 39 | + |
| 40 | + - name: Checkout |
| 41 | + uses: actions/checkout@master |
| 42 | + |
| 43 | + - name: Setup node |
| 44 | + uses: actions/setup-node@master |
| 45 | + with: |
| 46 | + node-version: ${{ matrix.node }} |
| 47 | + |
| 48 | + - name: Load Yarn cache |
| 49 | + uses: actions/cache@v2 |
| 50 | + with: |
| 51 | + path: ${{ steps.yarn-cache.outputs.dir }} |
| 52 | + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} |
| 53 | + restore-keys: ${{ runner.os }}-yarn- |
| 54 | + |
| 55 | + - name: Install dependencies |
| 56 | + run: yarn install --frozen-lockfile |
| 57 | + |
| 58 | + - name: Install specific Playwright version |
| 59 | + run: | |
| 60 | + yarn add -D ${{ matrix.playwright }} |
| 61 | + yarn why playwright |
| 62 | +
|
| 63 | + - name: Build |
| 64 | + run: yarn rebuild |
| 65 | + |
| 66 | + - name: Run lint + tests |
| 67 | + run: yarn validate |
| 68 | + |
| 69 | + - name: Upload Coverage / Release |
| 70 | + run: yarn ci-after-success |
| 71 | + if: ${{ matrix.node == '14' }} |
| 72 | + env: |
| 73 | + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 74 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments