-
-
Notifications
You must be signed in to change notification settings - Fork 189
60 lines (48 loc) · 1.74 KB
/
ci.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: CI
on:
push:
branches:
- master
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Current Repository
uses: actions/checkout@v3
- name: Set Up Node.js
uses: actions/setup-node@v4
with:
node-version: "20" # Use the appropriate version for your project
- name: Install xvfb # Required for running headless tests
if: env.ACT != 'true'
run: sudo apt update && sudo apt install -y xvfb
- name: Clone Zotero Plugin Scaffold # TEMP: Use the official repository once the PR is merged
run: |
git clone --branch add-test https://github.com/windingwind/zotero-plugin-scaffold.git zotero-plugin-scaffold
cd zotero-plugin-scaffold
npm install
npm run build
- name: Download and Extract Zotero Beta
run: |
wget -O zotero.tar.bz2 "https://www.zotero.org/download/client/dl?platform=linux-x86_64&channel=beta"
tar -xvf zotero.tar.bz2
echo "Zotero extracted successfully"
- name: Set Environment Variable for Zotero Bin Path
run: echo "ZOTERO_PLUGIN_ZOTERO_BIN_PATH=$PWD/Zotero_linux-x86_64/zotero" >> $GITHUB_ENV
- name: Initialize Current Repository
run: |
npm install
- name: Install Zotero Plugin Scaffold Locally
run: |
npm install ./zotero-plugin-scaffold
- name: Run Tests
run: |
xvfb-run npx zotero-plugin test --abortOnFail --exitOnFinish
env:
ZOTERO_PLUGIN_ZOTERO_BIN_PATH: ${{ env.ZOTERO_PLUGIN_ZOTERO_BIN_PATH }}
- name: Check Test Results
if: failure()
run: |
echo "Tests failed. CI is marked as failed."
exit 1