Skip to content

Commit 27f5b5c

Browse files
authored
Use github actions for CI (#552)
* feat(ci): add github action for running tests * fix?(ci): use xvfb-run * feat(ci): run tests on windows * fix(ci): typo * feat(ci): cache deps and electron * fix(ci): typo, step names * fix(ci): rename test action * fix(ci): proper windows cache dir * chore(ci): remove appveyor and travis config * docs: use github actions badges * fix(ci): remove electron cache * feat(ci): upload coverage to Codecov * fix(ci): only upload coverage on windows * fix(ci): only hash root yarn.lock for cache * fic(ci): disable cache on windows Windows `hashFiles` are broken, see actions/cache#95 for more info * feat(ci): enable node matrix * chore(Contributing): github actions for ci
1 parent 0a3e4be commit 27f5b5c

File tree

6 files changed

+52
-70
lines changed

6 files changed

+52
-70
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ VCP-electron-builder uses the [standard style guide](https://standardjs.com/), e
99

1010
### Testing
1111

12-
VCP-electron-builder uses [Jest](http://jestjs.io/) for testing. It has e2e tests for regular build and serve and typescript build and serve. Because of this, tests can take up to 5 minutes to run. If you have a slower computer (less than quad core) it might help to add the `--runInBand` argument to `yarn test`. The tests only work on Linux or Windows, not MacOS. Please run all tests and make sure they pass before submitting a pull request. [AppVeyor](https://www.appveyor.com/) is used for CI tests.
12+
VCP-electron-builder uses [Jest](http://jestjs.io/) for testing. It has e2e tests for regular build and serve and typescript build and serve. Because of this, tests can take up to 5 minutes to run. If you have a slower computer (less than quad core) it might help to add the `--runInBand` argument to `yarn test`. The tests only work on Linux or Windows, not MacOS. Please run all tests and make sure they pass before submitting a pull request. Github Actions are used for CI.

.github/workflows/nodeCI.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Node CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
build:
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, windows-latest]
14+
node: [ '12', '10', '8' ]
15+
include:
16+
- os: windows-latest
17+
commandPrefix: ''
18+
- os: ubuntu-latest
19+
commandPrefix: xvfb-run
20+
runs-on: ${{ matrix.os }}
21+
steps:
22+
- uses: actions/checkout@v1
23+
- name: Setup Node
24+
uses: actions/setup-node@v1
25+
with:
26+
node-version: ${{ matrix.node }}
27+
- name: Get yarn cache dir
28+
id: yarn-cache
29+
run: echo "::set-output name=dir::$(yarn cache dir)"
30+
- name: Yarn cache
31+
if: runner.os != 'Windows'
32+
uses: actions/cache@v1
33+
with:
34+
path: ${{ steps.yarn-cache.outputs.dir }}
35+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
36+
restore-keys: |
37+
${{ runner.os }}-yarn-
38+
- name: yarn install
39+
run: yarn install
40+
- name: yarn test
41+
run: ${{ matrix.commandPrefix }} yarn test --runInBand --coverage
42+
env:
43+
CI: true
44+
- name: Upload coverage to Codecov
45+
if: runner.os == 'Linux'
46+
uses: codecov/codecov-action@v1
47+
with:
48+
token: ${{secrets.CODECOV_TOKEN}}
49+
file: ./coverage/clover.xml

.travis.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A Vue Cli 3 plugin for Electron with no required configuration that uses [Electron Builder](https://www.electron.build/).
44

5-
Windows (Appveyor): [![Build status](https://ci.appveyor.com/api/projects/status/tyrr8kemli4vfll7?svg=true)](https://ci.appveyor.com/project/nklayman/vue-cli-plugin-electron-builder), Linux (Travis): [![Build Status](https://travis-ci.org/nklayman/vue-cli-plugin-electron-builder.svg?branch=master)](https://travis-ci.org/nklayman/vue-cli-plugin-electron-builder)
5+
Build status: [![Build status](https://github.com/nklayman/vue-cli-plugin-electron-builder/workflows/Node%20CI/badge.svg)](https://github.com/nklayman/vue-cli-plugin-electron-builder/actions)
66

77
[![Sponsor](./docs/.vuepress/public/sponsorShield.svg)](https://github.com/sponsors/nklayman)
88

appveyor.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

docs/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ footer: MIT Licensed | Copyright © 2018-present Noah Klayman
2525
</div>
2626
</div>
2727
<centered-markdown>
28-
Build Status:
29-
30-
Windows (Appveyor): [![Build status](https://ci.appveyor.com/api/projects/status/tyrr8kemli4vfll7?svg=true)](https://ci.appveyor.com/project/nklayman/vue-cli-plugin-electron-builder), Linux (Travis): [![Build Status](https://travis-ci.org/nklayman/vue-cli-plugin-electron-builder.svg?branch=master)](https://travis-ci.org/nklayman/vue-cli-plugin-electron-builder)
28+
Build status: [![Build status](https://github.com/nklayman/vue-cli-plugin-electron-builder/workflows/Node%20CI/badge.svg)](https://github.com/nklayman/vue-cli-plugin-electron-builder/actions)
3129

3230
</centered-markdown>

0 commit comments

Comments
 (0)