|
| 1 | +name: 'Tests: node.js' |
| 2 | + |
| 3 | +on: [pull_request, push] |
| 4 | + |
| 5 | +jobs: |
| 6 | + matrix: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + outputs: |
| 9 | + latest: ${{ steps.set-matrix.outputs.requireds }} |
| 10 | + steps: |
| 11 | + - uses: ljharb/actions/node/matrix@main |
| 12 | + id: set-matrix |
| 13 | + with: |
| 14 | + versionsAsRoot: true |
| 15 | + type: 'majors' |
| 16 | + preset: '^10 || ^12 || ^14 || ^16 || >= 17' |
| 17 | + |
| 18 | + base: |
| 19 | + needs: [matrix] |
| 20 | + name: 'base config' |
| 21 | + runs-on: ubuntu-latest |
| 22 | + |
| 23 | + strategy: |
| 24 | + fail-fast: false |
| 25 | + matrix: |
| 26 | + node-version: ${{ fromJson(needs.matrix.outputs.latest) }} |
| 27 | + eslint: |
| 28 | + - 7 |
| 29 | + - 6 |
| 30 | + - 5 |
| 31 | + package: |
| 32 | + - eslint-config-airbnb-base |
| 33 | + |
| 34 | + defaults: |
| 35 | + run: |
| 36 | + working-directory: "packages/${{ matrix.package }}" |
| 37 | + |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@v2 |
| 40 | + - uses: ljharb/actions/node/install@main |
| 41 | + name: 'nvm install ${{ matrix.node-version }} && npm install' |
| 42 | + with: |
| 43 | + node-version: ${{ matrix.node-version }} |
| 44 | + - run: npm run travis |
| 45 | + - uses: codecov/codecov-action@v2 |
| 46 | + |
| 47 | + react: |
| 48 | + needs: [matrix] |
| 49 | + name: 'react config' |
| 50 | + runs-on: ubuntu-latest |
| 51 | + |
| 52 | + strategy: |
| 53 | + fail-fast: false |
| 54 | + matrix: |
| 55 | + node-version: ${{ fromJson(needs.matrix.outputs.latest) }} |
| 56 | + eslint: |
| 57 | + - 7 |
| 58 | + - 6 |
| 59 | + - 5 |
| 60 | + package: |
| 61 | + - eslint-config-airbnb |
| 62 | + react-hooks: |
| 63 | + - '' |
| 64 | + - 3 |
| 65 | + - 2.3 |
| 66 | + - 1.7 |
| 67 | + |
| 68 | + defaults: |
| 69 | + run: |
| 70 | + working-directory: "packages/${{ matrix.package }}" |
| 71 | + |
| 72 | + steps: |
| 73 | + - uses: actions/checkout@v2 |
| 74 | + - uses: ljharb/actions/node/install@main |
| 75 | + name: 'nvm install ${{ matrix.node-version }} && npm install' |
| 76 | + with: |
| 77 | + node-version: ${{ matrix.node-version }} |
| 78 | + after_install: | |
| 79 | + npm install --no-save "eslint@${{ matrix.eslint }}" |
| 80 | + - run: npm install --no-save "eslint-plugin-react-hooks@${{ matrix.react-hooks }}" |
| 81 | + if: ${{ matrix.react-hooks > 0}} |
| 82 | + - run: npm run travis |
| 83 | + - uses: codecov/codecov-action@v2 |
| 84 | + |
| 85 | + prepublish-base: |
| 86 | + name: 'prepublish tests (base config)' |
| 87 | + runs-on: ubuntu-latest |
| 88 | + strategy: |
| 89 | + fail-fast: false |
| 90 | + matrix: |
| 91 | + eslint: |
| 92 | + - 7 |
| 93 | + - 6 |
| 94 | + - 5 |
| 95 | + package: |
| 96 | + - eslint-config-airbnb-base |
| 97 | + |
| 98 | + defaults: |
| 99 | + run: |
| 100 | + working-directory: "packages/${{ matrix.package }}" |
| 101 | + |
| 102 | + steps: |
| 103 | + - uses: actions/checkout@v2 |
| 104 | + - uses: ljharb/actions/node/install@main |
| 105 | + name: 'nvm install ${{ matrix.node-version }} && npm install' |
| 106 | + with: |
| 107 | + node-version: lts/* |
| 108 | + after_install: | |
| 109 | + npm install --no-save "eslint@${{ matrix.eslint }}" |
| 110 | + - run: npm run pretravis |
| 111 | + - run: npm run prepublish |
| 112 | + - run: npm run posttravis |
| 113 | + |
| 114 | + prepublish-react: |
| 115 | + name: 'prepublish tests (react config)'<
52F4
/div> |
| 116 | + runs-on: ubuntu-latest |
| 117 | + strategy: |
| 118 | + fail-fast: false |
| 119 | + matrix: |
| 120 | + eslint: |
| 121 | + - 7 |
| 122 | + - 6 |
| 123 | + - 5 |
| 124 | + package: |
| 125 | + - eslint-config-airbnb |
| 126 | + react-hooks: |
| 127 | + - '' |
| 128 | + - 3 |
| 129 | + - 2.3 |
| 130 | + - 1.7 |
| 131 | + |
| 132 | + defaults: |
| 133 | + run: |
| 134 | + working-directory: "packages/${{ matrix.package }}" |
| 135 | + |
| 136 | + steps: |
| 137 | + - uses: actions/checkout@v2 |
| 138 | + - uses: ljharb/actions/node/install@main |
| 139 | + name: 'nvm install ${{ matrix.node-version }} && npm install' |
| 140 | + with: |
| 141 | + node-version: lts/* |
| 142 | + after_install: | |
| 143 | + npm install --no-save "eslint@${{ matrix.eslint }}" |
| 144 | + - run: npm install --no-save "eslint-plugin-react-hooks@${{ matrix.react-hooks }}" |
| 145 | + if: ${{ matrix.react-hooks > 0}} |
| 146 | + - run: npm run pretravis |
| 147 | + - run: npm run prepublish |
| 148 | + - run: npm run posttravis |
| 149 | + |
| 150 | + node: |
| 151 | + name: 'node 10+' |
| 152 | + needs: [base, prepublish-base, react, prepublish-react] |
| 153 | + runs-on: ubuntu-latest |
| 154 | + steps: |
| 155 | + - run: 'echo tests completed' |
0 commit comments