build: run test on GitHub Actions

This commit is contained in:
EnixCoda 2020-06-21 23:37:35 +08:00
parent 184a91875a
commit 33eac8a8bc
No known key found for this signature in database
GPG key ID: 0C1A07377913A1DD
3 changed files with 22 additions and 9 deletions

View file

@ -1,4 +1,4 @@
name: Build
name: CI
on:
push:
@ -13,12 +13,18 @@ on:
- 'server/**'
jobs:
build:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Retrieve vscode icons
uses: actions/checkout@v2
with:
repository: 'vscode-icons/vscode-icons'
path: 'vscode-icons'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
@ -32,13 +38,19 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- name: Retrieve vscode icons
uses: actions/checkout@v2
with:
repository: 'vscode-icons/vscode-icons'
path: 'vscode-icons'
- name: Install deps
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
run: |
yarn
- name: Build
run: |
yarn
make build
- name: Test
uses: mujo-code/puppeteer-headful@master
env:
CI: 'true'
with:
args: yarn test

View file

@ -4,6 +4,7 @@ const CRX_PATH = path.resolve(__dirname, 'dist')
module.exports = {
launch: {
executablePath: process.env.PUPPETEER_EXEC_PATH, // set by mujo-code/puppeteer-headful
headless: false, // required for extensions
args: [`--disable-extensions-except=${CRX_PATH}`, `--load-extension=${CRX_PATH}`],
},

View file

@ -144,7 +144,7 @@ module.exports = {
testMatch: ['**/__tests__/cases/*.ts?(x)', '**/?(*.)+(spec|test).ts?(x)'],
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
testPathIgnorePatterns: ['/node_modules/', './*.d.ts'],
testPathIgnorePatterns: ['/node_modules/', '.d.ts$', '<rootDir>/vscode-icons/'],
// The regexp pattern or array of patterns that Jest uses to detect test files
// testRegex: [],