Merge pull request #707 from KwonIan/email_format_fix #937
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: jest_tests | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Generate build number | |
id: | |
build_id | |
# add a step output `steps.build_id.outputs.id` as the unique id | |
run: echo "::set-output name=id::$(date +%s)" | |
- name: Print new build number | |
run: echo "Build number is $BUILD_ID" | |
env: | |
BUILD_ID: ${{ steps.build_id.outputs.id }} | |
- uses: actions/checkout@v2 | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 12.x | |
registry-url: https://registry.npmjs.org/ | |
scope: '@mat-github-ci' | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Set up Python 3.7 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.7 | |
- uses: actions/cache@v1 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install dependencies | |
run: | | |
npm -v | |
node -v | |
npm i | |
npm install -g npm-snapshot | |
- name: Check files | |
run: | | |
npm run lint:yaml | |
- name: Run tests | |
run: | | |
pwd | |
npm run test | |
- name: Publish code coverage | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage/coverage-final.json | |
- name: Publish snapshot on npm | |
env: | |
BUILD_ID: ${{ steps.build_id.outputs.id }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: | | |
echo "Build number is $BUILD_ID" | |
npm-snapshot $BUILD_ID | |
npm run build-publish | |
npm publish --tag next | |
- name: Push a consumable branch | |
run: | | |
git config --global user.name 'Matthew Horton' | |
git config --global user.email '[email protected]' | |
git add ./dist --force | |
git diff-index --quiet HEAD || git commit -n -m "Push artifacts to build branch" | |
git push origin main:build --force | |
- name: Trigger integration test | |
uses: peter-evans/repository-dispatch@v1 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
repository: materialsproject/dash-mp-components | |
event-type: new-snapshot-version | |
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' |