build(deps): bump yaml and @hover/javascript #623
This file contains 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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
name: Build | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
- next | |
- alpha | |
- beta | |
jobs: | |
build: | |
name: Build + Test + Release / Node ${{ matrix.node }} / playwright@${{ matrix.playwright }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: ['14', '16', '18'] | |
# TODO: technically we still support down to 1.12 but `locator.waitFor` | |
# was introduced in 1.16 so anything earlier blows up type-checking. | |
# This minimum will be bumped in the next breaking release that will be | |
# entirely built around the `Locator` APIs, so update this then. | |
playwright: ['1.16.0', 'latest'] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Update to npm 7 | |
run: npm i -g npm@7 --registry=https://registry.npmjs.org | |
- uses: actions/cache@v3.2.6 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install dependencies | |
run: npm install | |
- name: Install specific Playwright version | |
run: | | |
npm install playwright@${{ matrix.playwright }} | |
npm install @playwright/test@${{ matrix.playwright }} | |
- name: Check types | |
run: npm run test:types | |
- name: Run lint + tests | |
if: ${{ matrix.playwright == 'latest' }} | |
run: | | |
npm why playwright | |
npm why @playwright/test | |
npm run test | |
- name: Run lint + tests | |
if: ${{ matrix.playwright != 'latest' }} | |
run: | | |
npm why playwright | |
npm why @playwright/test | |
npm run test:legacy | |
# Only release on Node 16 | |
- name: Upload Coverage / Release / Playwright | |
run: npm run ci-after-success | |
if: ${{ matrix.node == '14' && matrix.playwright == 'latest' }} | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set flag as to whether we released | |
id: did-release | |
run: echo "::set-output name=released::$(node ./playwright-test/check-package.js)" | |
- name: Setup NPM authentication for second publish | |
if: ${{ matrix.node == '14' && matrix.playwright == 'latest' && steps.did-release.outputs.released == 'true' }} | |
run: | | |
cat > .npmrc <<EOF | |
registry=https://registry.npmjs.org/ | |
@playwright-testing-library:registry=https://registry.npmjs.org/ | |
//registry.npmjs.org/:_authToken=$NPM_TOKEN | |
always-auth=true | |
unsafe-perm=true | |
EOF | |
env: | |
NPM_TOKEN: ${{ secrets.PLAYWRIGHT_TESTING_LIBRARY_TOKEN }} | |
- name: Set branch name | |
id: branch | |
run: echo ::set-output name=branch::${GITHUB_REF#refs/*/} | |
- name: Release / Playwright Test (latest) | |
if: ${{ matrix.node == '16' && matrix.playwright == 'latest' && steps.did-release.outputs.released == 'true' && steps.branch.outputs.branch == 'main' }} | |
run: | | |
npm run prepare:playwright-test | |
npm publish --access=public | |
- name: Release / Playwright Test (pre-release) | |
if: ${{ matrix.node == '16' && matrix.playwright == 'latest' && steps.did-release.outputs.released == 'true' && steps.branch.outputs.branch != 'main' }} | |
run: | | |
npm run prepare:playwright-test | |
npm publish --access=public --tag=${{ steps.branch.outputs.branch }} |