Pip plugins #413
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", "3.10", "3.11" ] | |
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 pycodestyle 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/ | |
pycodestyle fabsim/base/ fabsim/deploy/ fabsim/lib/ fabsim/UQP/ fabsim/VVP/ | |
- name: Run isort π | |
run: | | |
isort --profile hug --check --diff -l 80 fabsim/ |