forked from p2pderivatives/cfd-python
-
Notifications
You must be signed in to change notification settings - Fork 1
146 lines (135 loc) · 4.82 KB
/
check_pre-merge_master.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
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
134
135
136
137
138
139
140
141
142
143
144
145
146
name: master pre-merge check
on:
push:
branches:
- master
- stable_v*
- test/CI-*
paths-ignore:
- '.github/workflows/create_release-and-upload.yml'
- '.github/workflows/code_scanner.yml'
- 'README.md'
pull_request:
branches:
- master
- stable_v*
env:
GITHUB_VERSION: v0.2.5
GITHUB_BITCOIN_VERSION: v0.2.5
GITHUB_DOCKER_IMAGE: ghcr.io/cryptogarageinc/elements-testing
ENTRYPOINT_PATH: /github/workspace/.github/workflows/docker/test_entrypoint.sh
BITCOIN_ENTRYPOINT_PATH: /github/workspace/.github/workflows/docker/test_bitcoin_entrypoint.sh
jobs:
build-and-test:
name: build & test
timeout-minutes: 20
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['macos-13', 'macos-14', 'macos-15', 'windows-2019', 'windows-2022', 'ubuntu-20.04', 'ubuntu-22.04', 'ubuntu-24.04']
py-ver: ['3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.9', 'pypy-3.10']
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py-ver }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install setuptools
if: ${{ matrix.py-ver == '3.12' || matrix.py-ver == '3.13' }}
run: pip install --user setuptools
- name: build
run: python setup.py build
- name: copy dll
# for cpython 3.7, pypy 3.7-3.9
if: runner.os == 'Windows'
run: |
cp ./cmake_build/Release/*.dll ./cfd/
echo "$GITHUB_WORKSPACE/cfd" >> $GITHUB_PATH
shell: bash
- name: test
run: python -m unittest discover -v tests
pip-test:
name: pip test
timeout-minutes: 20
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['macos-13', 'macos-14', 'macos-15', 'windows-2019', 'windows-2022', 'ubuntu-20.04', 'ubuntu-22.04', 'ubuntu-24.04']
# py-ver: ['3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.9', 'pypy-3.10']
py-ver: ['3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.9']
include:
- os: windows-2019
py-ver: 'pypy-3.9'
package-path: 'c:\users\runneradmin\appdata\roaming\pypy\pypy39\site-packages'
# - os: windows-2019
# py-ver: 'pypy-3.10'
# package-path: 'c:\users\runneradmin\appdata\roaming\Python\PyPy310\site-packages'
- os: windows-2022
py-ver: 'pypy-3.9'
package-path: 'c:\users\runneradmin\appdata\roaming\pypy\pypy39\site-packages'
# - os: windows-2022
# py-ver: 'pypy-3.10'
# package-path: 'c:\users\runneradmin\appdata\roaming\Python\PyPy310\site-packages'
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py-ver }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: install pip
run: python -m pip install -U pip
- name: Install setuptools
if: ${{ matrix.py-ver == '3.12' || matrix.py-ver == '3.13' }}
run: pip install --user setuptools
- name: install
run: pip install --user .
- name: dump info
run: pip show cfd
- name: set path
# for cpython 3.7, pypy 3.7-3.9
if: runner.os == 'Windows' && matrix.package-path != ''
env:
PYTHON_PACKAGE_PATH: ${{ matrix.package-path }}
run: echo "$PYTHON_PACKAGE_PATH\cfd" >> $GITHUB_PATH
shell: bash
- name: call example
run: python ./tools/example.py
elements-e2e-test:
timeout-minutes: 40
name: elements e2e test
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: e2e-test
run: |
docker login docker.pkg.github.com -u owner -p ${{ secrets.GITHUB_TOKEN }}
docker pull ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_VERSION }}
docker run -u root -v ${{ github.workspace }}:/github/workspace --entrypoint ${{ env.ENTRYPOINT_PATH }} ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_VERSION }}
bitcoin-e2e-test:
timeout-minutes: 20
name: bitcoin e2e test
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: e2e-test
run: |
docker login docker.pkg.github.com -u owner -p ${{ secrets.GITHUB_TOKEN }}
docker pull ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_BITCOIN_VERSION }}
docker run -u root -v ${{ github.workspace }}:/github/workspace --entrypoint ${{ env.BITCOIN_ENTRYPOINT_PATH }} ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_BITCOIN_VERSION }}
doxygen-ubuntu:
name: doxygen-ubuntu
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: install_doxygen
run: sudo apt install doxygen graphviz
- name: doxygen_check
run: |
cd doc
doxygen Doxyfile_quiet_all