Skip to content

Commit f46efc9

Browse files
authored
Add nightly tests, step 1 (#521)
* Add nightly tests * typo fixes and disable fail-fast * typo fix * typo fix * Python: add not started tests * force reinstall * reinstall req * disable macos * specify py version * add package installation * --no-deps for test repo * -y for uninstall * Update nightly-tests.yml * Update nightly-tests.yml * Update nightly-tests.yml * Update nightly-tests.yml * update tests * fix * fix path import * try noninteractive * try noninteractive
1 parent ed0d5a9 commit f46efc9

File tree

2 files changed

+91
-8
lines changed

2 files changed

+91
-8
lines changed
Lines changed: 87 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,95 @@
11

2-
name: Nightly Tests
2+
name: Nightly Tests
33

44
on:
5+
schedule:
6+
- cron: '20 4 * * *'
57
workflow_dispatch:
68

79
jobs:
8-
empty-test:
10+
pip-test:
911
timeout-minutes: 20
10-
runs-on: ubunut-20.04
12+
runs-on: ${{matrix.os}}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [windows-latest, ubuntu-20.04] #, macos-latest]
17+
config: [Release, Test]
18+
include:
19+
- os: windows-latest
20+
py-version: "3.10"
21+
py-cmd: py -3.10
22+
- os: ubuntu-20.04
23+
py-version: "3.8"
24+
py-cmd: python3
25+
#- os: macos-latest
26+
# py-version: "3.10"
27+
#py-cmd: python3
28+
- config: Release
29+
pip-options: ""
30+
- config: Test
31+
pip-options: "-i https://test.pypi.org/simple/ --no-deps"
1132
steps:
12-
- name: Echo
13-
run: echo "seems to be working"
14-
15-
33+
- name: Checkout
34+
uses: actions/checkout@v3
35+
36+
- name: Python setup
37+
uses: actions/setup-python@v4
38+
with:
39+
python-version: ${{ matrix.py-version }}
40+
41+
- name: Install pip package
42+
run: |
43+
${{ matrix.py-cmd }} -m pip install --upgrade pip
44+
${{ matrix.py-cmd }} -m pip uninstall -y meshlib
45+
${{ matrix.py-cmd }} -m pip install --upgrade -r ./requirements/python.txt
46+
${{ matrix.py-cmd }} -m pip install ${{ matrix.pip-options }} meshlib
47+
48+
- name: Run Python tests
49+
working-directory: test_python
50+
run: ${{ matrix.py-cmd }} -m pytest -s -v
51+
52+
53+
54+
install-test:
55+
timeout-minutes: 10
56+
runs-on: ubuntu-latest
57+
container:
58+
image: ${{matrix.container}}
59+
options: --user root
60+
strategy:
61+
fail-fast: false
62+
matrix:
63+
os: [Ubuntu20, Ubuntu22, Fedroa35]
64+
include:
65+
- os: Ubuntu20
66+
container: ubuntu:20.04
67+
fileName: "*ubuntu20*"
68+
updateCmd: export DEBIAN_FRONTEND=noninteractive && apt-get -y update && apt-get -y upgrade && apt-get -y install sudo
69+
installCmd: apt-get -y install ./*.deb
70+
- os: Ubuntu22
71+
container: ubuntu:22.04
72+
fileName: "*ubuntu22*"
73+
updateCmd: export DEBIAN_FRONTEND=noninteractive && apt-get -y update && apt-get -y upgrade && apt-get -y install sudo
74+
installCmd: apt-get -y install ./*.deb
75+
- os: Fedroa35
76+
container: fedora:35
77+
fileName: "*-dev.rpm"
78+
updateCmd: dnf --refresh -y upgrade
79+
installCmd: dnf -y install ./*.rpm
80+
steps:
81+
- name: Download Release
82+
uses: robinraju/release-downloader@v1.5
83+
with:
84+
repository: MeshInspector/MeshLib
85+
latest: true
86+
fileName: ${{matrix.fileName}}
87+
out-file-path: ""
88+
89+
- name: Install Release
90+
run: |
91+
${{matrix.updateCmd}}
92+
${{matrix.installCmd}}
93+
94+
- name: Checkout
95+
uses: actions/checkout@v3

test_python/helper/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import os
22
import sys
33
import pytest
4+
45
# insert 0 to find mrpy.so in working directory and not in system
5-
sys.path.insert(0, os.environ["MeshLibPyModulesPath"])
6+
if "MeshLibPyModulesPath" in os.environ and not os.environ["MeshLibPyModulesPath"] in sys.path:
7+
sys.path.insert(0, os.environ["MeshLibPyModulesPath"])
8+
69
import meshlib.mrmeshpy as mrmesh

0 commit comments

Comments
 (0)