|
| 1 | +name: Windows CI |
| 2 | +on: [push, pull_request] |
| 3 | + |
| 4 | +jobs: |
| 5 | + prepare-commit-msg: |
| 6 | + name: Retrive head commit message |
| 7 | + runs-on: ubuntu-latest |
| 8 | + outputs: |
| 9 | + HEAD_COMMIT_MSG: ${{ steps.commitMsg.outputs.HEAD_COMMIT_MSG }} |
| 10 | + steps: |
| 11 | + - uses: actions/checkout@v1 |
| 12 | + if: github.event_name == 'pull_request' |
| 13 | + - name: find commit msg for PR |
| 14 | + id: commitMsg |
| 15 | + if: github.event_name == 'pull_request' |
| 16 | + run: echo "::set-output name=HEAD_COMMIT_MSG::$(git log --no-merges -1 --oneline)" |
| 17 | + check-skip: |
| 18 | + name: Check to skip CI |
| 19 | + needs: prepare-commit-msg |
| 20 | + runs-on: ubuntu-latest |
| 21 | + if: ${{ !contains(github.event.head_commit.message, '[ci skip]') && !contains(needs.prepare-commit-msg.outputs.HEAD_COMMIT_MSG, '[ci skip]') }} |
| 22 | + steps: |
| 23 | + - run: echo "${{ github.event.head_commit.message }}" |
| 24 | + smoke: |
| 25 | + name: Smoke on Node.js v${{ matrix.node }} |
| 26 | + needs: check-skip |
| 27 | + runs-on: windows-2019 |
| 28 | + strategy: |
| 29 | + matrix: |
| 30 | + node: [10, 12, 14] |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@v2 |
| 33 | + - uses: actions/setup-node@v1 |
| 34 | + with: |
| 35 | + node-version: ${{ matrix.node }} |
| 36 | + - run: npm install --production |
| 37 | + - run: ./bin/mocha --no-config --reporter spec test/smoke/smoke.spec.js |
| 38 | + prepare: |
| 39 | + name: Install dependencies |
| 40 | + runs-on: windows-2019 |
| 41 | + needs: smoke |
| 42 | + steps: |
| 43 | + - name: Cache Growl Installer |
| 44 | + id: cache-growl |
| 45 | + uses: actions/cache@v2 |
| 46 | + with: |
| 47 | + path: GrowlInstaller |
| 48 | + key: ${{ runner.os }}-growl-installer |
| 49 | + restore-keys: | |
| 50 | + ${{ runner.os }}-growl-installer |
| 51 | + - name: Download Growl Installer |
| 52 | + if: steps.cache-growl.outputs.cache-hit != 'true' |
| 53 | + run: | |
| 54 | + echo "Installing Growl..." |
| 55 | + mkdir GrowlInstaller | out-null |
| 56 | + $seaURL = "https://github.com/briandunnington/growl-for-windows/releases/download/final/GrowlInstaller.exe" |
| 57 | + $seaPath = "GrowlInstaller\GrowlInstaller.exe" |
| 58 | + $webclient = New-Object Net.WebClient |
| 59 | + $webclient.DownloadFile($seaURL, $seaPath) |
| 60 | + 7z x $seaPath -oGrowlInstaller | out-null |
| 61 | + test: |
| 62 | + name: Test on Node.js v${{ matrix.node }} |
| 63 | + needs: prepare |
| 64 | + runs-on: windows-2019 |
| 65 | + strategy: |
| 66 | + matrix: |
| 67 | + node: [10, 12, 14] |
| 68 | + steps: |
| 69 | + - name: Restore Growl Installer |
| 70 | + uses: actions/cache@v2 |
| 71 | + with: |
| 72 | + path: GrowlInstaller |
| 73 | + key: ${{ runner.os }}-growl-installer |
| 74 | + restore-keys: | |
| 75 | + ${{ runner.os }}-growl-installer |
| 76 | + - run: echo "::add-path::C:\Program Files (x86)\Growl for Windows" |
| 77 | + - name: Install Growl |
| 78 | + run: | |
| 79 | + echo "Installing Growl" |
| 80 | + cmd /c start /wait msiexec /i GrowlInstaller\Growl_v2.0.msi /quiet |
| 81 | + - uses: actions/checkout@v2 |
| 82 | + - uses: actions/setup-node@v1 |
| 83 | + with: |
| 84 | + node-version: ${{ matrix.node }} |
| 85 | + - run: npm ci --ignore-scripts |
| 86 | + - name: npm start test.node |
| 87 | + run: | |
| 88 | + echo "Starting Growl service..." |
| 89 | + Start-Process -NoNewWindow Growl |
| 90 | + ## Growl requires some time before it's ready to handle notifications |
| 91 | + echo "Verifying Growl responding" |
| 92 | + Start-Sleep -s 5 |
| 93 | + growlnotify test |
| 94 | + echo "Staring test" |
| 95 | + npm start test.node |
0 commit comments