-
Notifications
You must be signed in to change notification settings - Fork 30
55 lines (49 loc) · 1.66 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
name: CI
on: [ push, pull_request ]
jobs:
build:
name: Build, Upload, Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 20
- name: Cache Node modules
id: node-cache
uses: actions/cache@v3
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 ci
# Currently necessary for Webpack
env:
NODE_OPTIONS: --openssl-legacy-provider
- name: Build reader
run: npm run build
# Currently necessary for Webpack
env:
NODE_OPTIONS: --openssl-legacy-provider
- name: Upload pre-build ZIP
if: |
env.ACT != 'true'
&& github.repository == 'zotero/reader'
&& github.event_name == 'push'
&& (github.ref == 'refs/heads/master' || endsWith(github.ref, '-hotfix') || github.ref == 'refs/heads/gh-actions-ci-test')
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
mkdir build-zip
cd build
zip -r ../build-zip/$GITHUB_SHA.zip *
cd ..
sudo gem install --no-document dpl dpl-s3
dpl --provider=s3 --bucket=zotero-download --local-dir=build-zip --upload-dir=ci/client-reader --acl=public-read --skip_cleanup=true
- name: Run tests
run: npm run test