|
| 1 | +name: Node CI |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build: |
| 7 | + strategy: |
| 8 | + matrix: |
| 9 | + node: [8.x, 10.x, 12.x] |
| 10 | + os: [macOS-latest, ubuntu-latest] |
| 11 | + runs-on: ${{ matrix.os }} |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v1 |
| 14 | + - name: Use Node.js ${{ matrix.node }} |
| 15 | + uses: actions/setup-node@v1 |
| 16 | + with: |
| 17 | + node-version: ${{ matrix.node }} |
| 18 | + - name: setup yarn |
| 19 | + run: | |
| 20 | + curl -o- -L https://yarnpkg.com/install.sh | bash |
| 21 | + export PATH="$HOME/.yarn/bin:$PATH" |
| 22 | + - name: build, lint, test |
| 23 | + run: | |
| 24 | + yarn --frozen-lockfile |
| 25 | + yarn lint |
| 26 | + yarn build |
| 27 | + yarn test |
| 28 | + env: |
| 29 | + CI: true |
| 30 | + |
| 31 | + # codecov: |
| 32 | + # runs-on: macOS-latest |
| 33 | + # needs: build |
| 34 | + # steps: |
| 35 | + # - name: Report Test Code Coverage |
| 36 | + # if: matrix.node == '12.x' |
| 37 | + # run: | |
| 38 | + # yarn global add codecov codacy-coverage |
| 39 | + # codecov |
| 40 | + # cat ./coverage/lcov.info | codacy-coverage |
| 41 | + # env: |
| 42 | + # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
| 43 | + |
| 44 | + deploy: |
| 45 | + runs-on: macOS-latest |
| 46 | + needs: build |
| 47 | + steps: |
| 48 | + - name: Publish Release and npm Package |
| 49 | + if: github.event_name == 'push' && github.ref == 'master' && matrix.node == '12.x' |
| 50 | + run: bash deploy.sh |
| 51 | + env: |
| 52 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 53 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 54 | + GH_BRANCH: ${{ github.ref }} |
| 55 | + GH_REPO: ${{ github.repository }} |
| 56 | + |
| 57 | + codecheck: |
| 58 | + runs-on: macOS-latest |
| 59 | + needs: [build, deploy] |
| 60 | + steps: |
| 61 | + - name: Code Check |
| 62 | + if: matrix.node == '12.x' |
| 63 | + run: | |
| 64 | + yarn add -D @codechecks/client @codechecks/build-size-watcher |
| 65 | + yarn codechecks |
| 66 | + env: |
| 67 | + CC_SECRET: ${{ secrets.CC_SECRET }} |
0 commit comments