update test #17
Workflow file for this run
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 Uppercase build + matrix | |
| on: | |
| push: | |
| paths: | |
| -".github/workflows/python-uppercase-build.yml" | |
| - "py_app/**" | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| pyversion: ['3.11', '3.12'] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.pyversion }} | |
| - name: Install python dependencies | |
| uses: py-actions/py-dependency-install@v4 | |
| with: | |
| path: "py_app/requirements.txt" | |
| update-pip: "true" | |
| - name: Run tests | |
| working-directory: py_app | |
| run: pytest -v | |
| build: | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| pyversion: ['3.11', '3.12'] | |
| needs: test | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.pyversion }} | |
| - name: Install PyInstaller | |
| run: pip install pyinstaller | |
| - name: Build EXE file | |
| working-directory: py_app | |
| run: pyinstaller --onefile uppercase.py | |
| - name: Rename artifact before upload | |
| run: mv uppercase.exe uppercase-${{ matrix.pyversion }}.exe | |
| working-directory: py_app/dist | |
| - name: List files after build | |
| run: ls -R | |
| - name: Save artifacts to GitHub | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "uppercase-exe ${{ matrix.pyversion }}" | |
| path: "py_app/dist/uppercase-${{ matrix.pyversion }}.exe" | |
| #- name: Release | |
| # uses: softprops/action-gh-release@v2 | |
| # with: | |
| # files: py_app\dist\uppercase.exe | |
| # body: "Binaries of the uppercase program compiled for different Python versions" | |
| # tag_name: ${{ github.ref_name }} | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| permissions: | |
| contents: write # Allows publishing a release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts/ | |
| - name: List files | |
| run: ls -lR | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: artifacts/**/* | |
| body: "Binaries of the uppercase program compiled for different Python versions" | |
| tag_name: ${{ github.ref_name }} |