Files
material-web/.github/workflows/tests.yml
Daniel Freedman 12081ebba5 Remove format checks on commits (#3203)
Formatting is checked internally
2022-02-25 15:44:34 -08:00

47 lines
1.3 KiB
YAML

name: tests
on: [push, pull_request]
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 14
- name: NPM install
# ignore-scripts so that we skip postinstall, because postinstall runs
# bootstrap, and it's a little nicer to see that here as its own step
# when debugging.
run: npm ci --ignore-scripts
- name: Lerna bootstrap
run: npm run bootstrap
- name: Build component Sass
run: npm run build:styling
- name: Compile component TypeScript
run: npm run build:typescript
- name: Compile test TypeScript
run: npm run build:tests
- name: Unit tests
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
run: |
# Don't run Sauce from a forked repo, since the code may not be trusted
# and therefore secrets like the Sauce password are not available.
# GITHUB_HEAD_REF is only defined when building a fork.
if [ ! "$GITHUB_HEAD_REF" ]; then
export USE_SAUCE=true
export SAUCE_BUILD_ID=mwc-tests-${GITHUB_EVENT_NAME}-${GITHUB_ACTION}-${GITHUB_SHA}
export SAUCE_TUNNEL_ID=${SAUCE_BUILD_ID}-tunnel
fi
npm test