-
Notifications
You must be signed in to change notification settings - Fork 38
107 lines (92 loc) · 4.16 KB
/
Copy pathtest_conan_extensions.yml
File metadata and controls
107 lines (92 loc) · 4.16 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
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
104
105
106
107
on: [pull_request, workflow_dispatch]
jobs:
conan_linux:
runs-on: ubuntu-22.04
services:
artifactory:
image: releases-docker.jfrog.io/jfrog/artifactory-pro:latest
env:
JF_SHARED_DATABASE_TYPE: derby
JF_SHARED_DATABASE_ALLOWNONPOSTGRESQL: "true"
ports:
- 8081:8081
- 8082:8082
options: >-
--health-cmd "curl -f http://localhost:8081/artifactory/api/system/ping || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 10
--log-driver none
env:
CONAN_LOGIN_USERNAME_EXTENSIONS_PROD: ${{ secrets.ARTIFACTORY_USER }}
CONAN_PASSWORD_EXTENSIONS_PROD: ${{ secrets.ARTIFACTORY_USER_PASSWORD }}
CONAN_LOGIN_USERNAME_EXTENSIONS_STG: ${{ secrets.ARTIFACTORY_USER }}
CONAN_PASSWORD_EXTENSIONS_STG: ${{ secrets.ARTIFACTORY_USER_PASSWORD }}
ART_URL: http://localhost:8082/artifactory
steps:
- uses: actions/checkout@v3
- name: Check if Artifactory credentials are available
run: |
if [[ -n "${{ secrets.ARTIFACTORY_USER }}" && -n "${{ secrets.ARTIFACTORY_USER_PASSWORD }}" ]]; then
echo "HAS_ARTIFACTORY_CREDS=true" >> $GITHUB_ENV
else
echo "HAS_ARTIFACTORY_CREDS=false" >> $GITHUB_ENV
fi
- name: Wait for Artifactory to be ready
run: |
until curl -s http://localhost:8081/artifactory/api/system/ping; do
echo "Waiting for Artifactory to be ready..."
sleep 5
done
- name: Set Artifactory License
if: env.HAS_ARTIFACTORY_CREDS == 'true'
run: |
curl -u "${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_USER_PASSWORD }}" --output /dev/null \
-X POST "http://localhost:8081/artifactory/api/system/licenses" \
-H "Content-Type: application/json" \
-d "{ \"licenseKey\": \"${{ secrets.ARTIFACTORY_LICENSE }}\" }"
- name: Create Conan Local Repositories
if: env.HAS_ARTIFACTORY_CREDS == 'true'
run: |
curl -u "${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_USER_PASSWORD }}" --output /dev/null \
-X PUT "http://localhost:8081/artifactory/api/repositories/extensions-prod" \
-H "Content-Type: application/json" \
-d '{ "rclass": "local", "packageType": "conan", "repoLayoutRef": "conan-default", "description": "Local Conan repository for production" }'
curl -u "${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_USER_PASSWORD }}" --output /dev/null \
-X PUT "http://localhost:8081/artifactory/api/repositories/extensions-stg" \
-H "Content-Type: application/json" \
-d '{ "rclass": "local", "packageType": "conan", "repoLayoutRef": "conan-default", "description": "Local Conan repository for staging" }'
curl -u "${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_USER_PASSWORD }}" --output /dev/null \
-X PUT "http://localhost:8081/artifactory/api/repositories/third-party" \
-H "Content-Type: application/json" \
-d '{ "rclass": "local", "packageType": "conan", "repoLayoutRef": "conan-default", "description": "Local Conan repository for third-party testing" }'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
pip install -U pip
pip install pytest "cyclonedx-python-lib>=5.0.0,<6"
- name: Install Conan latest
run: pip install conan
- name: Run tests - Conan latest / Python 3.9
run: pytest -v tests
- name: Install Conan develop
run: pip install git+https://github.com/conan-io/conan.git@develop2
- name: Run tests - Conan develop / Python 3.9
run: pytest -v tests
conan_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies and Conan latest
run: |
pip install -U pip
pip install pytest conan
- name: Run Windows-specific tests - Conan latest / Python 3.9
run: pytest -v -m win32 tests