Ci/linux binary #183
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: Run Checks | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| python: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] | |
| os: [ ubuntu-latest, macos-latest, windows-latest ] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Get Python Version | |
| id: get_python_version | |
| run: echo "::set-output name=python_version::$(python --version)" | |
| - name: Cache dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: .venv | |
| key: ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-dependencies-${{ hashFiles('**/poetry.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-dependencies | |
| - name: Install Poetry | |
| run: pip install poetry poetry-plugin-export | |
| - name: Create Virtual Environment | |
| run: python -m venv .venv | |
| - name: Upgrade pip | |
| run: poetry run python -m pip install --upgrade pip | |
| - name: Install Dependencies | |
| run: poetry install | |
| - name: Run Black | |
| run: poetry run task black --check | |
| - name: Run isort | |
| run: poetry run task isort --check | |
| - name: Run safety | |
| run: poetry export -f requirements.txt | poetry run safety check --bare --stdin | |
| - name: Run mypy | |
| run: poetry run task mypy | |
| - name: Run pylint | |
| run: poetry run task pylint | |
| - name: Run pytest | |
| run: poetry run task test | |
| env: | |
| TASKIPY: true | |
| build-linux: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install binarylane-cli | |
| run: pip install . | |
| - name: Install PyInstaller | |
| run: pip install pyinstaller | |
| - name: Run PyInstaller | |
| run: pyinstaller --name bl --onefile --copy-metadata binarylane-cli --collect-submodules binarylane src/binarylane/console/__main__.py | |
| - name: Install StaticX | |
| run: pip install staticx | |
| - name: Install patchelf | |
| run: sudo apt install -y patchelf | |
| - name: Run StaticX | |
| run: staticx --strip --no-compress dist/bl dist/bl | |
| - uses: actions/upload-artifact@v3 | |
| with: | |
| name: linux-x64 | |
| path: dist/* |