|
15 | 15 | - "docs/**"
|
16 | 16 | - "*.md"
|
17 | 17 |
|
| 18 | +# Jobs got from https://github.com/fastify/workflows/blob/main/.github/workflows/plugins-ci.yml |
| 19 | +# and changed to use pnpm first |
| 20 | + |
18 | 21 | jobs:
|
19 | 22 | setup_pnpm:
|
20 |
| - runs-on: ubuntu-latest |
21 | 23 | steps:
|
22 | 24 | - name: Setup pnpm
|
23 | 25 | uses: pnpm/action-setup@v4
|
24 | 26 | with:
|
25 | 27 | version: 9
|
26 | 28 |
|
| 29 | + dependency-review: |
| 30 | + needs: [setup_pnpm] |
| 31 | + name: Dependency Review |
| 32 | + if: github.event_name == 'pull_request' |
| 33 | + runs-on: ubuntu-latest |
| 34 | + permissions: |
| 35 | + contents: read |
| 36 | + steps: |
| 37 | + - name: Check out repo |
| 38 | + uses: actions/checkout@v4 |
| 39 | + with: |
| 40 | + persist-credentials: false |
| 41 | + |
| 42 | + - name: Dependency review |
| 43 | + uses: actions/dependency-review-action@v4 |
| 44 | + |
| 45 | + license-check: |
| 46 | + if: > |
| 47 | + !failure() && |
| 48 | + !cancelled() && |
| 49 | + inputs.license-check == true |
| 50 | + name: Check Licenses |
| 51 | + runs-on: ubuntu-latest |
| 52 | + permissions: |
| 53 | + contents: read |
| 54 | + steps: |
| 55 | + - uses: actions/checkout@v4 |
| 56 | + with: |
| 57 | + persist-credentials: false |
| 58 | + |
| 59 | + - name: Setup Node |
| 60 | + uses: actions/setup-node@v4 |
| 61 | + with: |
| 62 | + node-version: lts/* |
| 63 | + |
| 64 | + - name: Install dependencies |
| 65 | + run: npm i --ignore-scripts |
| 66 | + |
| 67 | + - name: Check Licenses |
| 68 | + run: ${{ format('npx license-checker --production --summary --onlyAllow="0BSD;Apache-2.0;BlueOak-1.0.0;BSD-2-Clause;BSD-3-Clause;ISC;MIT;{0}"', inputs.license-check-allowed-additional) }} |
| 69 | + |
| 70 | + linter: |
| 71 | + needs: [setup_pnpm] |
| 72 | + name: Lint Code |
| 73 | + if: > |
| 74 | + !failure() && |
| 75 | + !cancelled() && |
| 76 | + inputs.lint == true |
| 77 | + runs-on: ubuntu-latest |
| 78 | + permissions: |
| 79 | + contents: read |
| 80 | + steps: |
| 81 | + - name: Check out repo |
| 82 | + uses: actions/checkout@v4 |
| 83 | + with: |
| 84 | + persist-credentials: false |
| 85 | + |
| 86 | + - name: Setup Node |
| 87 | + uses: actions/setup-node@v4 |
| 88 | + with: |
| 89 | + node-version: lts/* |
| 90 | + |
| 91 | + - name: Install dependencies |
| 92 | + run: pnpm i --ignore-scripts |
| 93 | + |
| 94 | + - name: Lint code |
| 95 | + run: pnpm lint |
| 96 | + |
27 | 97 | test:
|
28 | 98 | needs: [setup_pnpm]
|
29 |
| - uses: fastify/workflows/.github/workflows/plugins-ci.yml@v5 |
30 |
| - with: |
31 |
| - license-check: true |
32 |
| - lint: true |
| 99 | + name: Test |
| 100 | + runs-on: ${{ matrix.os }} |
| 101 | + permissions: |
| 102 | + contents: read |
| 103 | + strategy: |
| 104 | + matrix: |
| 105 | + node-version: ${{ fromJson(inputs.node-versions) }} |
| 106 | + os: [macos-latest, ubuntu-latest, windows-latest] |
| 107 | + exclude: |
| 108 | + - os: macos-latest |
| 109 | + node-version: 14 |
| 110 | + - os: macos-latest |
| 111 | + node-version: 16 |
| 112 | + steps: |
| 113 | + - name: Check out repo |
| 114 | + uses: actions/checkout@v4 |
| 115 | + with: |
| 116 | + persist-credentials: false |
| 117 | + |
| 118 | + - name: Setup Node ${{ matrix.node-version }} |
| 119 | + uses: actions/setup-node@v4 |
| 120 | + with: |
| 121 | + node-version: ${{ matrix.node-version }} |
| 122 | + |
| 123 | + - name: Install dependencies |
| 124 | + run: pnpm i --ignore-scripts |
| 125 | + |
| 126 | + - name: Run tests |
| 127 | + run: pnpm test |
| 128 | + |
| 129 | + fastify-dependency-integration: |
| 130 | + needs: [setup_pnpm] |
| 131 | + name: Test Fastify Integration |
| 132 | + runs-on: ubuntu-latest |
| 133 | + if: > |
| 134 | + !failure() && |
| 135 | + !cancelled() && |
| 136 | + inputs.fastify-dependency-integration == true |
| 137 | + permissions: |
| 138 | + contents: read |
| 139 | + steps: |
| 140 | + - name: Check out repo |
| 141 | + uses: actions/checkout@v4 |
| 142 | + with: |
| 143 | + persist-credentials: false |
| 144 | + |
| 145 | + - name: Setup Node |
| 146 | + uses: actions/setup-node@v4 |
| 147 | + with: |
| 148 | + node-version: lts/* |
| 149 | + |
| 150 | + - name: Install dependencies |
| 151 | + run: pnpm i --ignore-scripts |
| 152 | + |
| 153 | + - name: Test Fastify Integration |
| 154 | + run: | |
| 155 | + pnpm link && |
| 156 | + PACKAGE_NAME=$(node -p "require('./package.json').name") |
| 157 | + git clone https://github.com/fastify/fastify.git --depth 1 && |
| 158 | + cd fastify && |
| 159 | + pnpm i --ignore-scripts && |
| 160 | + pnpm link $PACKAGE_NAME && |
| 161 | + pnpm run unit |
0 commit comments