CM-27209 - Add latest CLI version check #541
Workflow file for this run
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
name: Unit Tests on all supported Python versions and OS | |
on: | |
pull_request: | |
branches: | |
- main | |
permissions: | |
contents: read | |
jobs: | |
unit_tests: | |
strategy: | |
matrix: | |
os: [ macos-latest, ubuntu-latest, windows-latest ] | |
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ] | |
runs-on: ${{matrix.os}} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Run Cimon | |
if: matrix.os == 'ubuntu-latest' | |
uses: cycodelabs/cimon-action@v0 | |
with: | |
client-id: ${{ secrets.CIMON_CLIENT_ID }} | |
secret: ${{ secrets.CIMON_SECRET }} | |
prevent: true | |
allowed-hosts: > | |
files.pythonhosted.org | |
install.python-poetry.org | |
pypi.org | |
*.ingest.us.sentry.io | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Load cached Poetry setup | |
id: cached-poetry | |
uses: actions/cache@v3 | |
with: | |
path: ~/.local | |
key: poetry-${{ matrix.os }}-${{ matrix.python-version }}-2 # increment to reset cache | |
- name: Setup Poetry | |
if: steps.cached-poetry.outputs.cache-hit != 'true' | |
uses: snok/install-poetry@v1 | |
with: | |
version: 1.8.3 | |
- name: Add Poetry to PATH | |
run: echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Install dependencies | |
run: poetry install | |
- name: Run executable test | |
# we care about the one Python version that will be used to build the executable | |
# TODO(MarshalX): upgrade to Python 3.13 | |
if: matrix.python-version == '3.12' | |
run: | | |
poetry run pyinstaller pyinstaller.spec | |
./dist/cycode-cli version | |
- name: Run pytest | |
run: poetry run python -m pytest |