|
1 |
| -name: Tests |
| 1 | +name: CI |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | push:
|
@@ -27,29 +27,26 @@ jobs:
|
27 | 27 | - name: Install deps
|
28 | 28 | run: yarn install
|
29 | 29 |
|
30 |
| - # Read existing version, reuse that, add a Git short hash |
31 |
| - # - name: Set build version to Git commit |
32 |
| - # run: node scripts/writeGitVersion.js $(git rev-parse --short HEAD) |
| 30 | + # Read existing version, reuse that, add a Git short hash |
| 31 | + - name: Set build version to Git commit |
| 32 | + run: node scripts/writeGitVersion.js $(git rev-parse --short HEAD) |
33 | 33 |
|
34 |
| - # - name: Check updated version |
35 |
| - # run: jq .version package.json |
| 34 | + - name: Check updated version |
| 35 | + run: jq .version package.json |
36 | 36 |
|
37 | 37 | - name: Run linter
|
38 | 38 | run: yarn lint
|
39 | 39 |
|
40 | 40 | - name: Run tests
|
41 | 41 | run: yarn test
|
42 | 42 |
|
43 |
| - - name: Compile |
44 |
| - run: yarn build |
45 |
| - |
46 | 43 | - name: Pack
|
47 | 44 | run: yarn pack
|
48 | 45 |
|
49 | 46 | - uses: actions/upload-artifact@v2
|
50 | 47 | with:
|
51 | 48 | name: package
|
52 |
| - path: packages/toolkit/package.tgz |
| 49 | + path: ./package.tgz |
53 | 50 |
|
54 | 51 | test-types:
|
55 | 52 | name: Test Types with TypeScript ${{ matrix.ts }}
|
|
82 | 79 | run: |
|
83 | 80 | yarn tsc --version
|
84 | 81 | yarn test:typescript
|
| 82 | +
|
| 83 | + test-published-artifact: |
| 84 | + name: Test Published Artifact ${{ matrix.example }} |
| 85 | + |
| 86 | + needs: [build] |
| 87 | + runs-on: ubuntu-latest |
| 88 | + strategy: |
| 89 | + fail-fast: false |
| 90 | + matrix: |
| 91 | + node: ['16.x'] |
| 92 | + example: [ |
| 93 | + 'cra4', |
| 94 | + 'cra5', |
| 95 | + 'next', |
| 96 | + 'vite' |
| 97 | + 'node-standard', |
| 98 | + 'node-esm', |
| 99 | + 'are-the-types-wrong', |
| 100 | + ] |
| 101 | + steps: |
| 102 | + - name: Checkout repo |
| 103 | + uses: actions/checkout@v2 |
| 104 | + |
| 105 | + - name: Use node ${{ matrix.node }} |
| 106 | + uses: actions/setup-node@v2 |
| 107 | + with: |
| 108 | + node-version: ${{ matrix.node }} |
| 109 | + cache: 'yarn' |
| 110 | + |
| 111 | + - name: Clone RTK repo |
| 112 | + run: git clone https://github.com/reduxjs/redux-toolkit.git ./redux-toolkit |
| 113 | + |
| 114 | + - name: Check folder contents |
| 115 | + run: ls -l . |
| 116 | + |
| 117 | + - name: Install deps |
| 118 | + working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }} |
| 119 | + run: yarn install |
| 120 | + |
| 121 | + - uses: actions/download-artifact@v2 |
| 122 | + with: |
| 123 | + name: package |
| 124 | + path: ./redux-toolkit/examples/publish-ci/${{ matrix.example }} |
| 125 | + |
| 126 | + - name: Check folder contents |
| 127 | + working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }} |
| 128 | + run: ls -l . |
| 129 | + |
| 130 | + - name: Install Redux-Thunk build artifact |
| 131 | + working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }} |
| 132 | + run: yarn add ./package.tgz |
| 133 | + |
| 134 | + - name: Show installed package versions |
| 135 | + working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }} |
| 136 | + run: yarn info redux-thunk && yarn why redux-thunk |
| 137 | + |
| 138 | + - name: Build example |
| 139 | + working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }} |
| 140 | + run: yarn build |
| 141 | + |
| 142 | + - name: Run test step |
| 143 | + working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }} |
| 144 | + run: yarn test |
0 commit comments