Skip to content

add space list and create operation #28

add space list and create operation

add space list and create operation #28

Workflow file for this run

name: Test GlassFlow Python SDK
on:
pull_request:
branches:
- main
- release/*
permissions:
contents: write
checks: write
pull-requests: write
jobs:
tests:
name: Run pytest tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python environment
uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: 'pip'
cache-dependency-path: setup.py
- name: Install dependencies
run: pip install -e .[dev]
- name: Run Tests
run: pytest
env:
SPACE_ID: ${{ secrets.INTEGRATION_SPACE_ID }}
PERSONAL_ACCESS_TOKEN: ${{ secrets.INTEGRATION_PERSONAL_ACCESS_TOKEN }}
- name: Upload coverage report
uses: actions/upload-artifact@master
with:
name: coverageReport
path: tests/reports/coverage.xml
checks:
name: Run code checks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python environment
uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: 'pip'
cache-dependency-path: setup.py
- name: Install dependencies
run: pip install -e .[dev]
- name: Run ruff linter checks
run: ruff check .
- name: Run ruff formatting checks
run: ruff format --check .
coverage:
runs-on: ubuntu-latest
needs: [tests]
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
- name: Download coverage report
uses: actions/download-artifact@master
with:
name: coverageReport
path: tests/reports/coverage.xml
- name: Pytest coverage comment
if: ${{ github.ref == 'refs/heads/main' }}
id: coverageComment
uses: MishaKav/pytest-coverage-comment@main
with:
hide-comment: true
pytest-xml-coverage-path: ./tests/reports/coverage.xml
- name: Update Readme with Coverage Html
if: ${{ github.ref == 'refs/heads/main' }}
run: |
sed -i '/<!-- Pytest Coverage Comment:Begin -->/,/<!-- Pytest Coverage Comment:End -->/c\<!-- Pytest Coverage Comment:Begin -->\n\${{ steps.coverageComment.outputs.coverageHtml }}\n<!-- Pytest Coverage Comment:End -->' ./README.md
- name: Commit & Push changes to Readme
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions-js/push@master
with:
message: Update coverage on Readme
github_token: ${{ secrets.GITHUB_TOKEN }}