Skip to content

Commit

Permalink
Merge pull request #523 from nexB/520-use-azure-ci
Browse files Browse the repository at this point in the history
520 use azure ci
  • Loading branch information
JonoYang committed Aug 8, 2024
2 parents 1b238ba + 9a6f988 commit eb6c708
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 125 deletions.
71 changes: 0 additions & 71 deletions .github/workflows/purldb-tests.yml

This file was deleted.

11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,11 @@ envfile:
@mkdir -p $(shell dirname ${ENV_FILE}) && touch ${ENV_FILE}
@echo SECRET_KEY=\"${GET_SECRET_KEY}\" > ${ENV_FILE}

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

isort:
@echo "-> Apply isort changes to ensure proper imports ordering"
Expand Down
58 changes: 14 additions & 44 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,60 +5,30 @@
# These jobs are using VMs with Azure-provided Python builds
################################################################################

resources:
containers:
- container: postgres
image: postgres:13
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432

jobs:

- template: etc/ci/azure-posix.yml
parameters:
job_name: ubuntu20_cpython
image_name: ubuntu-20.04
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
python_versions: ['3.10', '3.11', '3.12']
test_suites:
all: venv/bin/pytest -n 2 -vvs
all: make test

- template: etc/ci/azure-posix.yml
parameters:
job_name: ubuntu22_cpython
image_name: ubuntu-22.04
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos11_cpython
image_name: macOS-11
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos12_cpython
image_name: macOS-12
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos13_cpython
image_name: macOS-13
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-win.yml
parameters:
job_name: win2019_cpython
image_name: windows-2019
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
test_suites:
all: venv\Scripts\pytest -n 2 -vvs

- template: etc/ci/azure-win.yml
parameters:
job_name: win2022_cpython
image_name: windows-2022
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
python_versions: ['3.10', '3.11', '3.12']
test_suites:
all: venv\Scripts\pytest -n 2 -vvs
all: make test
12 changes: 9 additions & 3 deletions etc/ci/azure-posix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
test_suite_label: ${{ tsuite.key }}
test_suite: ${{ tsuite.value }}

services:
postgres: postgres

steps:
- checkout: self
fetchDepth: 10
Expand All @@ -30,9 +33,12 @@ jobs:
displayName: '${{ pyver }} - Install Python'

- script: |
python${{ pyver }} --version
echo "python${{ pyver }}" > PYTHON_EXECUTABLE
./configure --clean && ./configure --dev
make dev
make envfile_testing
sudo mkdir /etc/purldb
sudo cp .env /etc/purldb
sudo mkdir /etc/scancodeio
sudo cp .env /etc/scancodeio
displayName: '${{ pyver }} - Configure'
- script: $(test_suite)
Expand Down
1 change: 0 additions & 1 deletion purldb_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
)

# Database

DATABASES = {
'default': {
'ENGINE': env.str('PACKAGEDB_DB_ENGINE', 'django.db.backends.postgresql'),
Expand Down

0 comments on commit eb6c708

Please sign in to comment.