CI #6592
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
name: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
# Mainly for flakyness testing. | |
schedule: | |
- cron: "0 */6 * * *" | |
jobs: | |
test: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
node: [12, 14, 15, 16] | |
env: | |
SRTL_DEV: true | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use node@12 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node }} | |
- uses: microsoft/playwright-github-action@v1 | |
- run: yarn | |
- name: "Lockfile changes from running `yarn` committed?" | |
run: git diff --exit-code | |
- run: yarn format:check | |
- run: yarn test:types | |
- run: yarn test:ci | |
- name: "`yarn build:types` changes committed?" | |
run: | | |
yarn build:types | |
git diff --exit-code | |
- name: "examples/node/test.example.ps1" | |
shell: powershell | |
run: | | |
# Required config | |
# The path you cloned this repository to | |
$REPO_PATH = "${{ github.workspace }}" | |
# Optional config | |
# The path where NVDA speech output is logged. Need read/write access. | |
$LOG_FILE_PATH = "$REPO_PATH\nvda-node.log" | |
# The path where your package manager installed the "screen-reader-testing-library" package. | |
$PACKAGE_PATH = "$REPO_PATH\node_modules\screen-reader-testing-library" | |
# End of configuration. Changing anything below at your own risk | |
$NVDA_BIN = "$PACKAGE_PATH\bin\nvda.ps1" | |
& $NVDA_BIN -logFile $LOG_FILE_PATH | |
node $REPO_PATH\examples\node\index.js $LOG_FILE_PATH | |
& $NVDA_BIN -quit | |
- name: "examples/jest/test.example.ps1" | |
shell: powershell | |
run: | | |
# Required config | |
# The path you cloned this repository to | |
$REPO_PATH = "${{ github.workspace }}" | |
# Optional config | |
# The path where NVDA speech output is logged. Need read/write access. | |
$LOG_FILE_PATH = "$REPO_PATH\nvda-jest.log" | |
# The path where your package manager installed the "screen-reader-testing-library" package. | |
$PACKAGE_PATH = "$REPO_PATH\node_modules\screen-reader-testing-library" | |
# End of configuration. Changing anything below at your own risk | |
$NVDA_BIN = "$PACKAGE_PATH\bin\nvda.ps1" | |
$Env:LOG_FILE_PATH = $LOG_FILE_PATH | |
& $NVDA_BIN -logFilePath $Env:LOG_FILE_PATH | |
yarn jest -c $REPO_PATH\examples\jest\jest.config.js | |
& $NVDA_BIN -quit | |
- uses: actions/upload-artifact@v2 | |
if: ${{ always() }} | |
with: | |
name: nvda.log | |
path: | | |
nvda-node.log | |
nvda-jest.log | |
release: | |
name: Release | |
needs: [test] | |
if: ${{ github.event_name == 'push' }} | |
runs-on: ubuntu-latest | |
env: | |
SRTL_DEV: true | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@master | |
with: | |
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | |
fetch-depth: 0 | |
- name: Setup Node.js 12.x | |
uses: actions/setup-node@master | |
with: | |
node-version: 12.x | |
- name: Install Dependencies | |
run: yarn | |
- name: Install Dependencies | |
run: yarn | |
- name: Create Release Pull Request or Publish to npm | |
id: changesets | |
uses: changesets/action@master | |
with: | |
# This expects you to have a script called release which does a build for your packages and calls changeset publish | |
publish: yarn release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |