Fix tests (#816) #332
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: Test & Publish | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 14 | |
- name: Install yarn | |
run: npm install -g yarn | |
- name: Install dependencies | |
run: yarn install | |
- name: Lint lib/ | |
run: yarn lint | |
publish-npm: | |
needs: test | |
if: github.event_name == 'push' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code with ADMIN_TOKEN | |
if: github.event.pull_request.head.repo.full_name == github.repository | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.ADMIN_TOKEN }} | |
- name: Checkout code | |
if: github.event.pull_request.head.repo.full_name != github.repository | |
uses: actions/checkout@v2 | |
- name: Prepare repository | |
run: git fetch --unshallow --tags | |
- name: Set up node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 14 | |
- name: Install yarn | |
run: npm install -g yarn | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Cache node modules | |
uses: actions/cache@v1 | |
with: | |
path: node_modules | |
key: yarn-deps-${{ hashFiles('yarn.lock') }} | |
restore-keys: | | |
yarn-deps-${{ hashFiles('yarn.lock') }} | |
- name: Create Release | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
run: | | |
npx auto shipit |