|
| 1 | +name: NodeJS build and test |
| 2 | + |
| 3 | +on: push |
| 4 | + |
| 5 | +jobs: |
| 6 | + build: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + |
| 9 | + strategy: |
| 10 | + matrix: |
| 11 | + node-version: [12.x, 14.x, 16.x] |
| 12 | + |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v2 |
| 15 | + |
| 16 | + - name: Use Node.js ${{ matrix.node-version }} |
| 17 | + uses: actions/setup-node@v1 |
| 18 | + with: |
| 19 | + node-version: ${{ matrix.node-version }} |
| 20 | + |
| 21 | + - name: Build |
| 22 | + run: | |
| 23 | + npm install |
| 24 | + npm run build |
| 25 | +
|
| 26 | + - name: Upload public build artefacts |
| 27 | + |
| 28 | + with: |
| 29 | + # Artifact name |
| 30 | + name: npm-gulp-build-files-public |
| 31 | + # A file, directory or wildcard pattern that describes what to upload |
| 32 | + path: public |
| 33 | + # The desired behavior if no files are found using the provided path. |
| 34 | + if-no-files-found: error |
| 35 | + retention-days: 1 |
| 36 | + - name: Upload TS build artefacts |
| 37 | + |
| 38 | + with: |
| 39 | + # Artifact name |
| 40 | + name: npm-gulp-build-files-ts |
| 41 | + # A file, directory or wildcard pattern that describes what to upload |
| 42 | + path: src/js |
| 43 | + # The desired behavior if no files are found using the provided path. |
| 44 | + if-no-files-found: error |
| 45 | + retention-days: 1 |
| 46 | + |
| 47 | + lint: |
| 48 | + runs-on: ubuntu-latest |
| 49 | + |
| 50 | + needs: build |
| 51 | + continue-on-error: true |
| 52 | + |
| 53 | + strategy: |
| 54 | + matrix: |
| 55 | + node-version: [12.x, 14.x, 16.x] |
| 56 | + |
| 57 | + steps: |
| 58 | + - uses: actions/checkout@v2 |
| 59 | + |
| 60 | + - name: Download public build artefacts |
| 61 | + |
| 62 | + with: |
| 63 | + # Artifact name |
| 64 | + name: npm-gulp-build-files-public |
| 65 | + # Destination path |
| 66 | + path: public |
| 67 | + - name: Download TS build artefacts |
| 68 | + |
| 69 | + with: |
| 70 | + # Artifact name |
| 71 | + name: npm-gulp-build-files-ts |
| 72 | + # Destination path |
| 73 | + path: src/js |
| 74 | + |
| 75 | + - name: Use Node.js ${{ matrix.node-version }} |
| 76 | + uses: actions/setup-node@v1 |
| 77 | + with: |
| 78 | + node-version: ${{ matrix.node-version }} |
| 79 | + |
| 80 | + - name: Perform lint checks |
| 81 | + run: | |
| 82 | + npm i |
| 83 | + npm run quality:eslint |
| 84 | +
|
| 85 | + test: |
| 86 | + runs-on: ubuntu-latest |
| 87 | + |
| 88 | + needs: build |
| 89 | + |
| 90 | + strategy: |
| 91 | + matrix: |
| 92 | + node-version: [12.x, 14.x, 16.x] |
| 93 | + |
| 94 | + steps: |
| 95 | + - uses: actions/checkout@v2 |
| 96 | + |
| 97 | + - name: Download public build artefacts |
| 98 | + |
| 99 | + with: |
| 100 | + # Artifact name |
| 101 | + name: npm-gulp-build-files-public |
| 102 | + # Destination path |
| 103 | + path: public |
| 104 | + - name: Download TS build artefacts |
| 105 | + |
| 106 | + with: |
| 107 | + # Artifact name |
| 108 | + name: npm-gulp-build-files-ts |
| 109 | + # Destination path |
| 110 | + path: src/js |
| 111 | + |
| 112 | + - name: Use Node.js ${{ matrix.node-version }} |
| 113 | + uses: actions/setup-node@v1 |
| 114 | + with: |
| 115 | + node-version: ${{ matrix.node-version }} |
| 116 | + |
| 117 | + - name: Perform tests |
| 118 | + run: | |
| 119 | + npm i |
| 120 | + npm run generate-certs |
| 121 | + npm run test:unit |
0 commit comments