|
| 1 | +name: CI |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - '*' |
| 6 | + tags-ignore: |
| 7 | + - '*' |
| 8 | + pull_request: |
| 9 | + release: |
| 10 | + types: |
| 11 | + - published |
| 12 | +jobs: |
| 13 | + lint: |
| 14 | + name: Lint |
| 15 | + runs-on: ubuntu-latest |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v2 |
| 18 | + - uses: actions/setup-node@v2 |
| 19 | + with: |
| 20 | + node-version: 15 |
| 21 | + - run: npm ci |
| 22 | + - run: npm run-s test:lint |
| 23 | + prettier: |
| 24 | + name: Prettier |
| 25 | + runs-on: ubuntu-latest |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v2 |
| 28 | + - uses: actions/setup-node@v2 |
| 29 | + with: |
| 30 | + node-version: 15 |
| 31 | + - run: npm ci |
| 32 | + - run: npm run-s test:prettier |
| 33 | + flow: |
| 34 | + name: Flow |
| 35 | + runs-on: ubuntu-latest |
| 36 | + steps: |
| 37 | + - uses: actions/checkout@v2 |
| 38 | + - uses: actions/setup-node@v2 |
| 39 | + with: |
| 40 | + node-version: 15 |
| 41 | + - run: npm ci |
| 42 | + - run: npm run-s test:flow |
| 43 | + coverage: |
| 44 | + name: Coverage |
| 45 | + runs-on: ubuntu-latest |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v2 |
| 48 | + - uses: actions/setup-node@v2 |
| 49 | + with: |
| 50 | + node-version: 15 |
| 51 | + - run: npm ci |
| 52 | + - run: npm run-s test:unit |
| 53 | + - uses: coverallsapp/[email protected] |
| 54 | + with: |
| 55 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 56 | + test: |
| 57 | + name: Test - ${{ matrix.os }}/Node ${{ matrix.node_version }} |
| 58 | + strategy: |
| 59 | + fail-fast: false |
| 60 | + matrix: |
| 61 | + node_version: |
| 62 | + - 10 |
| 63 | + - 12 |
| 64 | + - 14 |
| 65 | + - 15 |
| 66 | + os: |
| 67 | + - macos-latest |
| 68 | + - ubuntu-latest |
| 69 | + - windows-latest |
| 70 | + runs-on: ${{ matrix.os }} |
| 71 | + steps: |
| 72 | + - uses: actions/checkout@v2 |
| 73 | + - uses: actions/setup-node@v2 |
| 74 | + with: |
| 75 | + node-version: ${{ matrix.node_version }} |
| 76 | + - run: npm ci |
| 77 | + - run: npm run-s test:unit |
| 78 | + build: |
| 79 | + name: Build - ${{ matrix.os }}/Node ${{ matrix.node_version }} |
| 80 | + strategy: |
| 81 | + fail-fast: false |
| 82 | + matrix: |
| 83 | + node_version: |
| 84 | + - 10 |
| 85 | + - 12 |
| 86 | + - 14 |
| 87 | + - 15 |
| 88 | + os: |
| 89 | + - macos-latest |
| 90 | + - ubuntu-latest |
| 91 | + - windows-latest |
| 92 | + runs-on: ${{ matrix.os }} |
| 93 | + steps: |
| 94 | + - uses: actions/checkout@v2 |
| 95 | + - uses: actions/setup-node@v2 |
| 96 | + with: |
| 97 | + node-version: ${{ matrix.node_version }} |
| 98 | + - run: npm ci |
| 99 | + - run: npm run-s build |
| 100 | + - run: npm install --prefix example |
| 101 | + - run: npm run --prefix example build |
| 102 | + deploy: |
| 103 | + needs: |
| 104 | + - lint |
| 105 | + - prettier |
| 106 | + - flow |
| 107 | + - test |
| 108 | + - coverage |
| 109 | + - build |
| 110 | + if: github.event.type == 'PushEvent' && github.ref == 'refs/heads/main' |
| 111 | + name: GitHub Pages |
| 112 | + runs-on: ubuntu-latest |
| 113 | + steps: |
| 114 | + - uses: actions/checkout@v2 |
| 115 | + - uses: actions/setup-node@v2 |
| 116 | + with: |
| 117 | + node-version: 15 |
| 118 | + - run: npm ci |
| 119 | + - run: npm run-s build |
| 120 | + - run: npm install --prefix example |
| 121 | + - run: npm run --prefix example build |
| 122 | + - uses: peaceiris/actions-gh-pages@v3 |
| 123 | + with: |
| 124 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 125 | + publish_dir: ./example/build |
| 126 | + publish: |
| 127 | + needs: |
| 128 | + - lint |
| 129 | + - prettier |
| 130 | + - flow |
| 131 | + - test |
| 132 | + - coverage |
| 133 | + - build |
| 134 | + if: github.event.action == 'published' |
| 135 | + name: Publish |
| 136 | + runs-on: ubuntu-latest |
| 137 | + steps: |
| 138 | + - uses: actions/checkout@v2 |
| 139 | + - uses: actions/setup-node@v2 |
| 140 | + with: |
| 141 | + registry-url: https://registry.npmjs.org/ |
| 142 | + node-version: 15 |
| 143 | + - run: npm ci |
| 144 | + - run: npm publish --access public |
| 145 | + env: |
| 146 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
0 commit comments