-
Notifications
You must be signed in to change notification settings - Fork 23
94 lines (75 loc) · 3.47 KB
/
RavenClient.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
92
93
name: tests/python
on:
push:
branches: [v5.2]
pull_request:
branches: [v5.2]
schedule:
- cron: '0 10 * * *'
workflow_dispatch:
inputs:
ravendb_version:
description: 'RavenDB Version'
required: true
type: string
jobs:
build:
runs-on: ubuntu-latest
env:
RAVENDB_BUILD_TYPE: nightly
RAVEN_License: ${{ secrets.RAVEN_LICENSE }}
RAVENDB_PYTHON_TEST_SERVER_PATH: ./RavenDB/Server/Raven.Server
RAVENDB_PYTHON_TEST_SERVER_CERTIFICATE_PATH: certs/server.pfx
RAVENDB_PYTHON_TEST_CLIENT_CERTIFICATE_PATH: certs/python.pem
RAVENDB_PYTHON_TEST_CA_PATH: /usr/local/share/ca-certificates/ca.crt
RAVENDB_PYTHON_TEST_HTTPS_SERVER_URL: https://localhost:7326
strategy:
matrix:
python-version: [ '3.7', '3.8', '3.10' ,'3.11', '3.12']
serverVersion: [ "5.4", "6.0", "6.1" ]
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Use Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version : ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Download RavenDB Server
run: |
if [[ -n "${{ inputs.ravendb_version }}" ]]; then
wget -O RavenDB.tar.bz2 "https://daily-builds.s3.amazonaws.com/RavenDB-${{ inputs.ravendb_version }}-linux-x64.tar.bz2"
else
wget -O RavenDB.tar.bz2 "https://hibernatingrhinos.com/downloads/RavenDB%20for%20Linux%20x64/latest?buildType=${{ env.RAVENDB_BUILD_TYPE }}&version=${{ matrix.serverVersion }}"
fi
- run: mkdir certs
- run: openssl genrsa -out certs/ca.key 2048
- run: openssl req -new -x509 -key certs/ca.key -out certs/ca.crt -subj "/C=US/ST=Arizona/L=Nevada/O=RavenDB Test CA/OU=RavenDB test CA/CN=localhost/[email protected]"
- run: openssl genrsa -out certs/localhost.key 2048
- run: openssl req -new -key certs/localhost.key -out certs/localhost.csr -subj "/C=US/ST=Arizona/L=Nevada/O=RavenDB Test/OU=RavenDB test/CN=localhost/[email protected]" -addext "subjectAltName = DNS:localhost"
- run: openssl x509 -req -extensions ext -extfile cert/test_cert.conf -in certs/localhost.csr -CA certs/ca.crt -CAkey certs/ca.key -CAcreateserial -out certs/localhost.crt
- run: cat certs/localhost.key certs/localhost.crt > certs/python.pem
- run: openssl pkcs12 -passout pass:"" -export -out certs/server.pfx -inkey certs/localhost.key -in certs/localhost.crt
- run: sudo cp certs/ca.crt /usr/local/share/ca-certificates/ca.crt
- run: sudo update-ca-certificates
- name: Extract RavenDB Server
run: tar xjf RavenDB.tar.bz2
- name: Upgrade pip
run: python -m pip install -U pip
- name: Install client deps
run: pip install -e .
- name: Install embedded RavenDB
run: pip install ravendb-embedded
- name: Run certifi script
run: python ./.github/workflows/add_ca.py
- name: Deploy certificates
run: mkdir RavenDB/Server/certs && cp certs/server.pfx RavenDB/Server/certs/
- name: Install black linter
if: ${{ matrix.python-version != '3.7' }}
run: pip install black
- name: Check code format
if: ${{ matrix.python-version != '3.7' }}
run: black --check .
- name: Run tests
run: python -m unittest discover