Skip to content

Commit 28f970e

Browse files
authored
ci(win): setup GH actions for windows CI (#4402)
* ci(win): setup GH actions for windows CI * ci(win): retire AppVeyor * ci(win): install production deps for smoke test * ci(win): remove lint from Windows CI * ci(win): skip ci base on commit msg * install growl on Windows CI * cache growl on Windows CI Signed-off-by: Outsider <outsideris@gmail.com>
1 parent 738a575 commit 28f970e

File tree

5 files changed

+98
-79
lines changed

5 files changed

+98
-79
lines changed

.github/CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Follow these steps to get going. If you are having trouble, don't be afraid to [
5858
- Keep your PR focused. Don't fix two things at once; don't upgrade dependencies unless necessary.
5959
1. Before committing, run `npm start test`.
6060
- This will run both Node.js-based and browser-based tests.
61-
- Ultimately, your pull request will be built on our continuous integration servers ([Travis CI](https://travis-ci.org/mochajs/mocha) and [AppVeyor](https://ci.appveyor.com/project/boneskull/mocha)). The first step to ensuring these checks pass is to test on your own machine.
61+
- Ultimately, your pull request will be built on our continuous integration servers ([Travis CI](https://travis-ci.org/mochajs/mocha) and [GitHub Actions](https://github.com/mochajs/mocha/actions?query=workflow%3A%22Windows+CI%22)). The first step to ensuring these checks pass is to test on your own machine.
6262
- A coverage check will be sent to [Coveralls](https://coveralls.io/github/mochajs/mocha). **A drop in code coverage % is considered a failed check**.
6363
1. Commit your changes.
6464
- Use a brief message on the first line, referencing a relevant issue (e.g. `closes #12345`).

.github/workflows/windows-ci.yml

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
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

MAINTAINERS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ _It's easier to release often._
346346
1. These changes are then added to the Git "stage" and will be added to the commit.
347347
1. Push `master` to `origin` with your new tag; e.g. `git push origin master --tags`
348348
1. Copy & paste the `CHANGELOG.md` lines to a new GitHub "release". Save release as draft.
349-
1. Meanwhile, you can check [the build](https://travis-ci.org/mochajs/mocha) on Travis-CI and [AppVeyor](https://ci.appveyor.com/project/boneskull/mocha).
349+
1. Meanwhile, you can check [the build](https://travis-ci.org/mochajs/mocha) on Travis-CI and [GitHub Actions](https://github.com/mochajs/mocha/actions?query=workflow%3A%22Windows+CI%22).
350350
1. Once the build is green, you'll want to trigger an update of `mochajs.org`:
351351
1. _If you're doing a prerelease_, fast-forward the `next` branch to `master`, and push it. This updates [https://next.mochajs.org](https://next.mochajs.org). That's all.
352352
1. _If this is NOT a prerelease_, fast-forward the `mochajs.org` branch to `master` and push it. This updates [https://mochajs.org](https://mochajs.org).

appveyor.yml

-76
This file was deleted.

karma.conf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ module.exports = config => {
104104
throw new Error('no browser tests should run on AppVeyor!');
105105
} else {
106106
console.error(`Local environment (${hostname}) detected`);
107-
// don't need to run sauce from appveyor b/c travis does it.
107+
// don't need to run sauce from Windows CI b/c travis does it.
108108
if (env.SAUCE_USERNAME || env.SAUCE_ACCESS_KEY) {
109109
const id = `${hostname} (${Date.now()})`;
110110
sauceConfig = {

0 commit comments

Comments
 (0)