chore(ui-number-input,ui-scripts): move generateA11yTests to ui-scripts #681
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: AUTO npm release and docs deploy - on master | |
on: | |
# Trigger the workflow on push or pull request, | |
# but only for the master branch | |
push: | |
branches: | |
- master | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
name: Release to npm | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
cache: 'npm' | |
- name: Install packages. | |
run: npm ci | |
- name: Set up project. | |
run: npm run bootstrap | |
- name: Run tests. | |
run: USE_REACT_STRICT_MODE=0 npm run test:patchset | |
- name: Release to NPM | |
env: | |
NPM_TOKEN: ${{secrets.NPM_TOKEN}} | |
NPM_EMAIL: ${{secrets.NPM_EMAIL}} | |
NPM_USERNAME: ${{secrets.NPM_USERNAME}} | |
run: npm run release | |
tag: | |
needs: release | |
if: "startsWith(github.event.head_commit.message, 'chore(release)')" | |
runs-on: ubuntu-latest | |
name: Tag release commit | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up git identity | |
run: git config --global user.name "instructure-ui-ci" && git config --global user.email "[email protected]" | |
# -a -m is needed to make the tag "annotated". Lerna needs annotated tags to work correctly with verisons | |
- name: Add tag | |
run: git tag -a v$(./.github/workflows/calculateVersion.sh) -m v$(./.github/workflows/calculateVersion.sh) | |
- name: Push tags | |
run: git push origin v$(./.github/workflows/calculateVersion.sh) | |
deploy-docs: | |
needs: release | |
if: "startsWith(github.event.head_commit.message, 'chore(release)')" | |
runs-on: ubuntu-latest | |
name: Deploy docs to Netlify | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
cache: 'npm' | |
- name: Install netlify-cli | |
run: npm install --save-dev [email protected] | |
- name: Install packages. | |
run: npm ci | |
- name: Set up project. | |
run: npm run bootstrap | |
- name: Build docs-app. | |
run: npm run build:docs | |
- name: Copy redirects config file to the __build__ directory. | |
run: cp ./packages/__docs__/_redirects ./packages/__docs__/__build__ | |
- name: Deploy built docs-app to Netlify. | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
run: npx netlify deploy --prod --dir ./packages/__docs__/__build__ | |
regression-test: | |
needs: release | |
if: "!startsWith(github.event.head_commit.message, 'chore(release)')" | |
name: Regression testing | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
browser: [chrome, firefox] | |
bundler: [esbuild, webpack4] | |
defaults: | |
run: | |
working-directory: ./regression-test | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
cache: 'npm' | |
- name: Retrieve latest snapshot version | |
run: node prepare.js | |
- name: Install dependencies for regression testing | |
run: npm install --no-package-lock | |
- name: Build project and start the server | |
run: | | |
npm run build:${{ matrix.bundler }} | |
npm run serve & | |
- name: Run regression tests | |
run: npx testcafe ${{ matrix.browser }}:headless ./src/test.ts |