forked from fossology/fossology-python
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (56 loc) · 1.8 KB
/
Copy pathfossologytests.yml
File metadata and controls
61 lines (56 loc) · 1.8 KB
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
name: API Tests
on:
pull_request:
paths-ignore:
- '**cli**'
jobs:
test-latest:
name: Integration Tests (Fossology - Latest)
runs-on: ubuntu-latest
container:
image: python:3.11-slim
volumes:
- /tmp:/tmp
services:
fossology:
image: fossology/fossology:4.4.0
ports:
- 8081:80
volumes:
- /tmp:/tmp
steps:
- uses: actions/checkout@v1
- name: Install host dependencies
run: |
apt-get -qq update
apt-get install -qq bzip2 curl gcc git nmap xz-utils
rm -rf /var/lib/apt/lists/*
- name: Install Python dependencies
run: |
pip install poetry
poetry install --with=dev
- name: Install files in shared volume
run: |
tar xvf tests/files/base-files_10.3-debian10-test.tar.bz2 -C /tmp
- name: Check services
run: |
nmap fossology -p 80
for i in $(seq 1 60); do
if curl --fail --silent --show-error http://fossology/repo/api/v1/info > /dev/null; then
echo "Fossology API is up"
break
fi
if [ "$i" -eq 60 ]; then
echo "Fossology API did not become ready in time" >&2
exit 1
fi
echo "Waiting for Fossology API... attempt $i/60"
sleep 5
done
- name: Run tests
run: |
poetry run coverage run --source=fossology -m pytest --ignore-glob="tests/test_foss_cli*.py"
poetry run coverage report -m
- name: upload codecoverage results only if the PR originates from the upstream repository
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
run: poetry run codecov -t ${{ secrets.CODECOV_TOKEN }}