remove config nonsense #1248
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: Tests | |
on: [push, pull_request] | |
jobs: | |
unittest: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.9, '3.10', '3.11', '3.12'] | |
steps: | |
- name: Checkout PyAutoConf | |
uses: actions/checkout@v2 | |
with: | |
repository: rhayes777/PyAutoConf | |
path: PyAutoConf | |
- name: Checkout PyAutoArray | |
uses: actions/checkout@v2 | |
with: | |
path: PyAutoArray | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/cache@v2 | |
id: cache-pip | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
# if: steps.cache-pip.outputs.cache-hit != 'true' | |
run: | | |
pip3 install --upgrade pip | |
pip3 install setuptools | |
pip3 install wheel | |
pip3 install pytest coverage pytest-cov | |
pip3 install -r PyAutoConf/requirements.txt | |
pip3 install -r PyAutoArray/requirements.txt | |
pip3 install -r PyAutoArray/optional_requirements.txt | |
cd PyAutoArray/autoarray/util/nn/src/nn | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/runner/work/PyAutoArray/PyAutoArray/PyAutoArray/autoarray/util/nn/src/nn | |
bash ./configure | |
cp makefile_autolens makefile | |
make | |
cd /home/runner/work/PyAutoArray/PyAutoArray | |
- name: Extract branch name | |
shell: bash | |
run: | | |
cd PyAutoArray | |
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | |
id: extract_branch | |
- name: Change to same branch if exists in deps | |
shell: bash | |
run: | | |
export PACKAGES=("PyAutoConf") | |
export BRANCH="${{ steps.extract_branch.outputs.branch }}" | |
for PACKAGE in ${PACKAGES[@]}; do | |
pushd $PACKAGE | |
export existed_in_remote=$(git ls-remote --heads origin ${BRANCH}) | |
if [[ -z ${existed_in_remote} ]]; then | |
echo "Branch $BRANCH did not exist in $PACKAGE" | |
else | |
echo "Branch $BRANCH did exist in $PACKAGE" | |
git fetch | |
git checkout $BRANCH | |
fi | |
popd | |
done | |
- name: Run tests | |
run: | | |
export ROOT_DIR=`pwd` | |
export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoConf | |
export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoArray | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/runner/work/PyAutoArray/PyAutoArray/PyAutoArray/autoarray/util/nn/src/nn | |
pushd PyAutoArray | |
python3 -m pytest --cov autoarray --cov-report xml:coverage.xml | |
- name: Slack send | |
if: ${{ failure() }} | |
id: slack | |
uses: slackapi/slack-github-action@v1.21.0 | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
with: | |
channel-id: C03S98FEDK2 | |
payload: | | |
{ | |
"text": "${{ github.repository }}/${{ github.ref_name }} (Python ${{ matrix.python-version }}) build result: ${{ job.status }}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
} |