Merge pull request #97 from ko-matsu/feature/test-python-12 #105
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.3 | |
GITHUB_BITCOIN_VERSION: v0.2.3 | |
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-11', 'macos-12', 'macos-13', 'windows-2019', 'windows-2022', 'ubuntu-20.04', 'ubuntu-22.04'] | |
py-ver: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10'] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
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' }} | |
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-11', 'macos-12', 'macos-13', 'windows-2019', 'windows-2022', 'ubuntu-20.04', 'ubuntu-22.04'] | |
# py-ver: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10'] | |
py-ver: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.8', 'pypy-3.9'] | |
include: | |
- os: windows-2019 | |
py-ver: 'pypy-3.8' | |
package-path: 'c:\users\runneradmin\appdata\roaming\pypy\pypy38\site-packages' | |
- 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.8' | |
package-path: 'c:\users\runneradmin\appdata\roaming\pypy\pypy38\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@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
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' }} | |
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-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- 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-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- 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@v3 | |
- name: install_doxygen | |
run: sudo apt install doxygen graphviz | |
- name: doxygen_check | |
run: | | |
cd doc | |
doxygen Doxyfile_quiet_all |