forked from zotero/translators
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (53 loc) · 2.09 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
61
62
63
name: CI
on: [push, pull_request]
jobs:
build:
name: Lint, Check, Test
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
with:
submodules: true
# We're in a shallow single-branch clone, so get the origin/master HEAD if not already on master
# and get more history on the current branch so we can find the branch point
- run: git fetch origin master:master --depth=1
if: github.ref != 'refs/heads/master'
- run: git fetch --update-shallow --depth=100 origin $(git rev-list HEAD)
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: 17
# Local via act
- name: Install packages for act
if: env.ACT == 'true'
run: apt update && apt install -y xvfb git rsync
- name: Get current connector hash
id: get-connector-hash
run: |
echo "::set-output name=hash::$(git ls-remote https://github.com/zotero/zotero-connectors.git refs/heads/master | awk -F '\\s+' '{print $1}')"
shell: bash
- name: Cache connector code
id: connector-cache
uses: actions/cache@v2
with:
path: .ci/pull-request-check/connectors
key: connectors-${{ hashFiles('.ci/pull-request-check/check-pull-request.sh') }}-${{ steps.get-connector-hash.outputs.hash }}
- name: Install node packages
run: npm ci
#- name: Debugging with tmate
# uses: mxschmitt/[email protected]
- name: Test pull request
if: github.event_name == 'pull_request'
env:
BROWSER_EXECUTABLE: /home/runner/work/translators/translators/.ci/pull-request-check/xvfb-run-chrome
run: ./check-pull-request.sh
working-directory: .ci/pull-request-check
- name: Check deleted.txt
run: ./checkDeletedTxt.sh
working-directory: .ci
if: ${{ success() || failure() }}
- name: Lint
run: ./lint.sh
working-directory: .ci
if: ${{ success() || failure() }}