forked from Dominic-DallOsto/zotero-api-endpoint
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (32 loc) · 1.23 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: test
on:
pull_request:
push:
branches:
- "master"
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: 14
- name: Cache Node modules
id: node-cache
uses: actions/cache@v2
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Install Node modules
if: steps.node-cache.outputs.cache-hit != 'true'
run: npm install
- name: Build plugin
run: npm run build
- name: Build
run: docker build -t zotero docker/
# For some reason these tests only work if the container is in interactive mode and not detached...
- name: run tests
run: echo 'bash -c "echo $(readlink -f build) >> .zotero/zotero/abcdefgh.test/extensions/[email protected] && xvfb-run zotero & sleep 5s && newman run test/zotero-api-endpoint.postman_collection.json -g test/workspace.postman_globals.json --verbose"' | docker run -i --rm -v $(readlink -f build):/home/zotero/build -v $(readlink -f test):/home/zotero/test --name zotero zotero