Initial draft of Python-based CLI with Template management commands #4
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: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build-test-lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install Poetry | |
| run: pip install poetry | |
| # Configure Poetry to use NI Artifacts credentials for the private repository | |
| # These secrets must be set in the GitHub repository settings | |
| - name: Configure Poetry for NI Artifacts | |
| run: | | |
| # Poetry will use these credentials for the 'rnd-pypi-ci' source defined in pyproject.toml | |
| poetry config http-basic.rnd-pypi-ci ${{ secrets.NIARTIFACTS_USER }} ${{ secrets.NIARTIFACTS_TOKEN }} | |
| - name: Install dependencies | |
| run: poetry install | |
| - name: Lint with ni-python-styleguide | |
| run: poetry run ni-python-styleguide lint | |
| - name: Lint with black | |
| run: poetry run black --check . | |
| - name: Run tests | |
| run: poetry run pytest | |
| - name: Build Homebrew tarball and update formula | |
| run: poetry run python scripts/build_homebrew.py | |
| - name: Upload Homebrew tarball artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: slcli-tarball | |
| path: dist/slcli.tar.gz |