This repository was archived by the owner on Nov 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
133 lines (114 loc) · 3.65 KB
/
ci.yml
File metadata and controls
133 lines (114 loc) · 3.65 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Test wip branches
on:
push:
# Run on every branches which will be merged on dev
branches-ignore:
- master
- main
- release
- develop
tags-ignore:
- "**"
env:
PYTHONPATH: "src"
jobs:
check:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install '.[dev,deploy]'
- name: Code format with black
run: |
python -m black --check $PYTHONPATH
- name: Import check with isort
run: |
python -m isort --check $PYTHONPATH
- name: Lint check with pylint
run: |
python -m pylint $PYTHONPATH
- name: Type check with mypy
run: |
python -m mypy $PYTHONPATH
- name: Lint check with pycodestyle
run: |
python -m pycodestyle $PYTHONPATH
- name: Lint check with pydocstyle
run: |
python -m pydocstyle $PYTHONPATH
- name: Run unit tests
run: |
python -m pytest -m "not cloud and not home"
# tests-cloud:
# runs-on: [self-hosted, not-sgx]
# needs: check
# steps:
# # Solve perm denied issue on GA
# # see: https://github.com/actions/checkout/issues/211
# - name: Chown user
# run: |
# echo $USER
# echo $GITHUB_WORKSPACE
# sudo chown -R $USER:$USER $GITHUB_WORKSPACE
#
# - uses: actions/checkout@v3
#
# - name: Set up Python 3.8
# uses: actions/setup-python@v4
# with:
# python-version: 3.8
#
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# python -m pip install '.[dev,deploy]'
#
# - name: Run integration tests
# env:
# MSE_BASE_URL: "https://ci.backend.dev.mse.cosmian.com"
# MSE_AUTH0_CLIENT_ID: "bx2WlLrS7qr35iyNqUVTs9jMo834o8mC"
# MSE_AUTH0_DOMAIN_NAME: "https://console-dev.eu.auth0.com"
# MSE_AUTH0_AUDIENCE: "https://console-dev.eu.auth0.com/api/v2/"
# REFRESH_TOKEN: ${{ secrets.DEV_ALICE_REFRESH_TOKEN }}
# MSE_TEST_DOMAIN_NAME: ${{ vars.DEV_MSE_TEST_DOMAIN_NAME }}
# MSE_TEST_PRIVATE_KEY: ${{ secrets.DEV_MSE_TEST_PRIVATE_KEY }}
# MSE_TEST_PUBLIC_KEY: ${{ vars.DEV_MSE_TEST_PUBLIC_KEY }}
# MSE_CONF_PATH: ${{ github.workspace }}
# run: |
# echo 'email = "alice@cosmian.com"' > ${MSE_CONF_PATH}/login.toml
# echo "refresh_token = \"${REFRESH_TOKEN}\"" >> ${MSE_CONF_PATH}/login.toml
# echo "Running tests using ${MSE_BASE_URL}"
# python -m pytest -m cloud
tests-home:
runs-on: [self-hosted, sgx]
needs: check
steps:
# Solve perm denied issue on GA
# see: https://github.com/actions/checkout/issues/211
- name: Chown user
run: |
sudo chown -R $USER:$USER $GITHUB_WORKSPACE
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install '.[dev,deploy]'
- name: Run unit tests
env:
TEST_SIGNER_KEY: /opt/cosmian-internal/cosmian-signer-key.pem
TEST_PCCS_URL: https://pccs.staging.mse.cosmian.com
run: |
python -m pytest -m home