Backward-compatible discovery of new and old-style plugins in plugins… #398
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: Run Tests | |
on: | |
push: | |
pull_request: | |
branches: ["master"] | |
env: | |
PY_COLORS: 1 | |
jobs: | |
build: | |
name: Python ${{ matrix.python-version }} ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ "ubuntu-latest", "macOS-latest" ] | |
python-version: [ "3.7", "3.8", "3.9" ] | |
steps: | |
- name: Checkout 🛎️ | |
uses: "actions/checkout@v2" | |
- name: Set up Python ${{ matrix.python-version }} 🐍 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Setup System & Info 💻 | |
run: | | |
python -c "from multiprocessing import cpu_count ; print('cpu_count={}'.format(cpu_count()))" | |
if [ "$RUNNER_OS" == "macOS" ]; then | |
echo "***************************" | |
system_profiler SPHardwareDataType | |
echo "***************************" | |
elif [ "$RUNNER_OS" == "Linux" ]; then | |
echo "***************************" | |
lscpu | egrep 'Model name|Socket|Thread|NUMA|CPU\(s\)' | |
lshw -short -C memory | |
echo "***************************" | |
fi | |
if [ "$RUNNER_OS" == "macOS" ]; then | |
echo "export PATH=$PATH:/Users/runner/Library/Python/${{ matrix.python-version }}/bin" >> ~/.bash_profile | |
echo "export PATH=$PATH:/Users/runner/.local/bin >>" ~/.bash_profile | |
echo "sw_vers" >> ~/.bash_profile | |
source ~/.bash_profile | |
which ssh-copy-id | |
fi | |
echo "export PATH=$PATH:~/.local/bin/" >> ~/.bash_profile | |
source ~/.bash_profile | |
python3 --version | |
python --version | |
ls -la ~/ | |
- name: Setup SSH 🔐 | |
run: | | |
mkdir -p ~/.ssh | |
rm -f ~/.ssh/id_rsa || true | |
if [ "$RUNNER_OS" == "macOS" ]; then | |
chmod g-w ~/.ssh | |
chmod o-w ~/.ssh | |
elif [ "$RUNNER_OS" == "Linux" ]; then | |
chmod g-w $HOME | |
chmod o-w $HOME | |
fi | |
# ssh-keygen -t rsa -b 4096 -C "$(whoami)@localhost" -f ~/.ssh/id_rsa | |
# cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys | |
# chmod og-wx ~/.ssh/authorized_keys | |
# ssh-keyscan -H localhost >> ~/.ssh/known_hosts | |
# cat ~/.ssh/authorized_keys | |
- name: Install Python Dependencies 📥 | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install --upgrade ruamel.yaml pytest==5.4.3 pytest-pep8 pep8 pytest-timeout rich | |
python3 -m pip install isort | |
- name: Setup FabSim 🚦🚦🚦 | |
run: | | |
python3 configure_fabsim.py | |
echo "export PATH=$(pwd)/fabsim/bin:$PATH" >> ~/.bash_profile | |
echo "export PYTHONPATH=$(pwd):$PYTHONPATH" >> ~/.bash_profile | |
source ~/.bash_profile | |
fabsim localhost install_plugin:FabDummy | |
fabsim localhost install_plugin:FabDummy | |
pip freeze | |
- name: Test with pytest 🚀 | |
run: | | |
source ~/.bash_profile | |
python3 -m pytest --timeout=60 -vv --log-cli-level=10 tests/ | |
pytest --pep8 fabsim/base/ fabsim/deploy/ fabsim/lib/ fabsim/UQP/ fabsim/VVP/ | |
- name: Run isort 🚀 | |
run: | | |
isort --profile hug --check --diff -l 80 fabsim/ |