-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (89 loc) · 2.68 KB
/
build-and-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
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
name: Build and Test Kive
on: push
jobs:
build:
runs-on: ubuntu-22.04
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
ports:
# Opens tcp port on the host and service container
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
KIVE_DB_USER: postgres
KIVE_DB_PASSWORD: postgres
KIVE_DB_HOST: localhost
KIVE_STATIC_ROOT: /tmp/kive_test_static_root
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Update apt index
run: sudo apt-get update
- name: Install apt packages
run: sudo apt-get install -y -q dh-autoreconf build-essential libarchive-dev squashfs-tools
- name: Install node
uses: actions/setup-node@v2
with:
node-version: '12.13.1'
- name: Install Kive's Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-test.txt
- name: Install node dependencies
run: npm install
- uses: actions/setup-go@v2
with:
go-version: '^1.15.6'
- name: Install Singularity
run: |
sudo apt-get install -qq \
build-essential \
uuid-dev \
libgpgme-dev \
squashfs-tools \
libseccomp-dev \
wget \
pkg-config \
git \
cryptsetup-bin
git clone https://github.com/singularityware/singularity.git
cd singularity
git checkout -q tags/v3.6.3
./mconfig && \
make -C ./builddir && \
sudo make -C ./builddir install
cd ..
rm -rf singularity
singularity --version
- run: npm run test:travis
- name: Test with pytest
run: |
cd kive
python manage.py collectstatic --no-input
coverage run -m pytest --flake8
- name: Test API with pytest
run: |
cd api
coverage run --source=kiveapi -m pytest
- name: Upload main coverage to Codecov
uses: codecov/codecov-action@v3
with:
directory: kive
- name: Upload API coverage to Codecov
uses: codecov/codecov-action@v3
with:
directory: api