-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (86 loc) · 3.11 KB
/
tests.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Run Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
# * is a special character in YAML so you have to quote this string
- cron: "0 3 * * 6"
workflow_dispatch:
inputs:
reason:
description: "Reason"
required: false
default: "Manual trigger"
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install prerequisites
run: |
sudo apt-get install -y pkg-config libxml2-dev libxmlsec1-dev libxmlsec1-openssl
- name: set up docker
uses: docker/setup-buildx-action@v3
- name: Set up Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Install pipenv
run: |
python -m pip install --upgrade pip
pip install pipenv
- name: Install python dependencies
run: pipenv install --dev
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Create config files
run: |
echo "[cli]" >> .invenio.private && \
echo "services_setup=False" >> .invenio.private && \
echo "instance_path=/opt/invenio/var/instance" >> .invenio.private
touch site/tests/.env
- name: Run tests
env:
COMMONS_API_TOKEN: ${{ secrets.TEST_COMMONS_API_TOKEN }}
COMMONS_API_TOKEN_PROD: ${{ secrets.TEST_COMMONS_API_TOKEN_PROD }}
COMMONS_SEARCH_API_TOKEN: ${{ secrets.TEST_COMMONS_SEARCH_API_TOKEN }}
INVENIO_SEARCH_DOMAIN: ${{ vars.INVENIO_SEARCH_DOMAIN }}
INVENIO_ADMIN_EMAIL: ${{ secrets.TEST_INVENIO_ADMIN_EMAIL }}
SQLALCHEMY_DATABASE_URI: ${{ vars.TEST_SQLALCHEMY_DATABASE_URI }}
INVENIO_SQLALCHEMY_DATABASE_URI: ${{ vars.TEST_SQLALCHEMY_DATABASE_URI }}
POSTGRESQL_USER: ${{ vars.POSTGRES_USER }}
POSTGRESQL_PASSWORD: ${{ vars.POSTGRES_DB }}
POSTGRESQL_DB: ${{ vars.POSTGRES_DB }}
INVENIO_COMMONS_API_REQUEST_PROTOCOL: https
INVENIO_MAIL_SUPPRESS_SEND: False
SPARKPOST_API_KEY: ${{ secrets.TEST_SPARKPOST_API_KEY }}
SPARKPOST_USERNAME: ${{ secrets.TEST_SPARKPOST_USERNAME }}
run: |
chmod +x site/run_tests.sh
cd site
bash run_tests.sh
# TODO: Add frontend tests
# - name: Run eslint test
# run: ./run-js-linter.sh -i
# - name: Run translations test
# run: ./run-i18n-tests.sh
# - name: Install deps for frontend tests
# working-directory: ./site/kcworks/assets/semantic-ui/js/kcworks
# run: npm install
# - name: Install deps for frontend tests - translations
# working-directory: ./translations/kcworks
# run: npm install
# - name: Run frontend tests
# working-directory: ./site/kcworks/assets/semantic-ui/js/kcworks
# run: npm test