fix unzip #9
This file contains hidden or 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: Python Package using pip | |
| on: | |
| push: | |
| branches: | |
| - '*' | |
| tags: | |
| - '*' | |
| jobs: | |
| test-linux: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| max-parallel: 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.11.2 | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: '3.11.2' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install flake8 | |
| - 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 --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
| # considers the latest release, not a hardcoded one! | |
| - name: Get reference results | |
| run: | | |
| URL=$(curl -s https://api.github.com/repos/ifpen/bemol/releases/latest \ | |
| | jq -r '.assets[] | select(.name=="pytest-results.zip") | .browser_download_url') | |
| if [ -z "$URL" ] || [ "$URL" = "null" ]; then | |
| echo "pytest-results.zip not found in latest release assets" | |
| exit 1 | |
| fi | |
| curl -L -o pytest-results.zip "$URL" | |
| unzip pytest-results.zip | |
| mv tests/results tests/ref/ | |
| - name: Test with pytest | |
| run: | | |
| pytest tests/ -vvs --reference tests/ref/ | |
| zip -r pytest-results.zip tests/results | |
| - name: Upload pytest-results artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pytest-results | |
| path: pytest-results.zip | |
| retention-minutes: 30 |