Merge pull request #571 from hildogjr/dependabot/github_actions/dot-g… #465
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Python application | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# '3.5', disabled, GitHub seems to be removing it | |
# '2.7', removed on June 19 2023 | |
python-version: ['3.7', '3.9', '3.11'] | |
name: Python test for ${{ matrix.python-version }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 pytest xlsx2csv==0.7.8 wheel | |
sed -i 's/^wxPython/#wxPython/' requirements.txt | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
# pip install git+https://github.com/set-soft/kicost-digikey-api-v3.git | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --statistics | |
- name: Test with pytest | |
run: | | |
pip install . | |
echo "* Python 3 version" | |
/usr/bin/python3 --version | |
echo "* Python version" | |
python --version | |
echo "* pip install destination" | |
which kicost | |
echo "* pip generated entry point" | |
cat `which kicost` | |
echo "* pip installed KiCost" | |
kicost --info | |
echo "* Python local installation" | |
ls -la $pythonLocation | |
echo "* Environment" | |
export | |
echo "* Patching src/kicost" | |
echo "#!"$pythonLocation/python > src/kicost.new | |
tail -n +2 src/kicost >> src/kicost.new | |
mv src/kicost.new src/kicost | |
chmod +x src/kicost | |
echo "* Patched src/kicost" | |
cat src/kicost | |
echo "* Patched src/kicost info" | |
src/kicost --info | |
echo "* Running tests" | |
pytest | |
- name: Store results | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v1 | |
with: | |
name: Test_Output_${{ matrix.python-version }} | |
path: tests | |