Skip to content

Commit eb6c708

Browse files
authored
Merge pull request #523 from nexB/520-use-azure-ci
520 use azure ci
2 parents 1b238ba + 9a6f988 commit eb6c708

File tree

5 files changed

+28
-125
lines changed

5 files changed

+28
-125
lines changed

.github/workflows/purldb-tests.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.

Makefile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,11 @@ envfile:
5050
@mkdir -p $(shell dirname ${ENV_FILE}) && touch ${ENV_FILE}
5151
@echo SECRET_KEY=\"${GET_SECRET_KEY}\" > ${ENV_FILE}
5252

53-
envfile_testing:
54-
@echo "-> Create the .env file and generate a secret key"
55-
@if test -f ${ENV_FILE}; then echo ".env file exists already"; exit 1; fi
56-
@mkdir -p $(shell dirname ${ENV_FILE}) && touch ${ENV_FILE}
57-
@echo SECRET_KEY=\"${GET_SECRET_KEY}\" >> ${ENV_FILE}
58-
@echo SCANCODEIO_DB_PORT=\"5433\" >> ${ENV_FILE}
53+
envfile_testing: envfile
54+
@echo PACKAGEDB_DB_USER=\"postgres\" >> ${ENV_FILE}
55+
@echo PACKAGEDB_DB_PASSWORD=\"postgres\" >> ${ENV_FILE}
56+
@echo SCANCODEIO_DB_USER=\"postgres\" >> ${ENV_FILE}
57+
@echo SCANCODEIO_DB_PASSWORD=\"postgres\" >> ${ENV_FILE}
5958

6059
isort:
6160
@echo "-> Apply isort changes to ensure proper imports ordering"

azure-pipelines.yml

Lines changed: 14 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -5,60 +5,30 @@
55
# These jobs are using VMs with Azure-provided Python builds
66
################################################################################
77

8+
resources:
9+
containers:
10+
- container: postgres
11+
image: postgres:13
12+
env:
13+
POSTGRES_USER: postgres
14+
POSTGRES_PASSWORD: postgres
15+
ports:
16+
- 5432:5432
17+
818
jobs:
919

1020
- template: etc/ci/azure-posix.yml
1121
parameters:
1222
job_name: ubuntu20_cpython
1323
image_name: ubuntu-20.04
14-
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
24+
python_versions: ['3.10', '3.11', '3.12']
1525
test_suites:
16-
all: venv/bin/pytest -n 2 -vvs
26+
all: make test
1727

1828
- template: etc/ci/azure-posix.yml
1929
parameters:
2030
job_name: ubuntu22_cpython
2131
image_name: ubuntu-22.04
22-
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
23-
test_suites:
24-
all: venv/bin/pytest -n 2 -vvs
25-
26-
- template: etc/ci/azure-posix.yml
27-
parameters:
28-
job_name: macos11_cpython
29-
image_name: macOS-11
30-
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
31-
test_suites:
32-
all: venv/bin/pytest -n 2 -vvs
33-
34-
- template: etc/ci/azure-posix.yml
35-
parameters:
36-
job_name: macos12_cpython
37-
image_name: macOS-12
38-
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
39-
test_suites:
40-
all: venv/bin/pytest -n 2 -vvs
41-
42-
- template: etc/ci/azure-posix.yml
43-
parameters:
44-
job_name: macos13_cpython
45-
image_name: macOS-13
46-
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
47-
test_suites:
48-
all: venv/bin/pytest -n 2 -vvs
49-
50-
- template: etc/ci/azure-win.yml
51-
parameters:
52-
job_name: win2019_cpython
53-
image_name: windows-2019
54-
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
55-
test_suites:
56-
all: venv\Scripts\pytest -n 2 -vvs
57-
58-
- template: etc/ci/azure-win.yml
59-
parameters:
60-
job_name: win2022_cpython
61-
image_name: windows-2022
62-
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
32+
python_versions: ['3.10', '3.11', '3.12']
6333
test_suites:
64-
all: venv\Scripts\pytest -n 2 -vvs
34+
all: make test

etc/ci/azure-posix.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ jobs:
1818
test_suite_label: ${{ tsuite.key }}
1919
test_suite: ${{ tsuite.value }}
2020

21+
services:
22+
postgres: postgres
23+
2124
steps:
2225
- checkout: self
2326
fetchDepth: 10
@@ -30,9 +33,12 @@ jobs:
3033
displayName: '${{ pyver }} - Install Python'
3134

3235
- script: |
33-
python${{ pyver }} --version
34-
echo "python${{ pyver }}" > PYTHON_EXECUTABLE
35-
./configure --clean && ./configure --dev
36+
make dev
37+
make envfile_testing
38+
sudo mkdir /etc/purldb
39+
sudo cp .env /etc/purldb
40+
sudo mkdir /etc/scancodeio
41+
sudo cp .env /etc/scancodeio
3642
displayName: '${{ pyver }} - Configure'
3743
3844
- script: $(test_suite)

purldb_project/settings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@
107107
)
108108

109109
# Database
110-
111110
DATABASES = {
112111
'default': {
113112
'ENGINE': env.str('PACKAGEDB_DB_ENGINE', 'django.db.backends.postgresql'),

0 commit comments

Comments
 (0)