Merge enhancement into master
#2
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: CI/CD Pipeline | |
| on: | |
| push: | |
| tags: '*.*.*' | |
| release: | |
| types: [ published ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: | |
| - '3.8' | |
| - '3.9' | |
| - '3.10' | |
| - '3.11' | |
| - '3.12' | |
| - '3.13' | |
| - '3.14' | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e . --extra-index-url https://source.md.land/python/ | |
| python -m pip install pytest pytest-cov | |
| # pip install -e ".[test]" | |
| - name: Run tests | |
| run: | | |
| # python -m pytest tests/ --cov=lib --cov-report=xml | |
| export PYTHONPATH="$(pwd -P)/lib:$PYTHONPATH" | |
| python -m pytest tests/unit/md/processor/processor.py --cov=lib --cov-report=term | |
| # - name: Upload coverage to Codecov | |
| # uses: codecov/codecov-action@v3 | |
| # if: matrix.python-version == '3.10' | |
| # with: | |
| # file: ./coverage.xml | |
| # fail_ci_if_error: true | |
| security: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install safety | |
| run: pip install safety | |
| - name: Check dependencies for vulnerabilities | |
| run: safety check --full-report | |
| - name: Install bandit | |
| run: pip install bandit | |
| - name: Static security analysis | |
| run: bandit -r lib/ -f json -o bandit-report.json --skip B101 | |
| type-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install mypy | |
| run: pip install mypy | |
| - name: Install dependencies | |
| run: pip install -e . --extra-index-url https://source.md.land/python/ | |
| - name: Type checking | |
| run: | | |
| export PYTHONPATH="$(pwd -P)/lib:$PYTHONPATH" | |
| mypy lib/ --disable-error-code import-untyped | |
| build: | |
| needs: [test, security, type-check] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install build dependencies | |
| run: pip install build wheel | |
| - name: Build wheel package | |
| run: python -m build --wheel | |
| - name: List artifacts | |
| run: ls -la dist/ | |
| - name: Upload wheel to GitHub Releases | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: dist/*.whl | |
| tag: ${{ github.ref }} | |
| overwrite: true | |
| file_glob: true |