Merge remote-tracking branch 'origin/main' #140
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: "CI" | |
on: | |
push: | |
jobs: | |
code-format: | |
name: "π Python code format" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "π₯ Check-out" | |
uses: actions/checkout@v3 | |
- name: "π§° Install Python" | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: pip | |
cache-dependency-path: pyproject.toml | |
- name: "π§° Install Protoc" | |
run: sudo apt install protobuf-compiler | |
- name: "π§° Install dependencies" | |
run: | | |
python -m pip install --upgrade pip | |
pip install . | |
pip install .[tests] | |
- name: "π Check Python code format" | |
run: flake8 archive_query_log/ | |
lint: | |
name: "π Python Lint" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "π₯ Check-out" | |
uses: actions/checkout@v3 | |
- name: "π§° Install Python" | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: pip | |
cache-dependency-path: pyproject.toml | |
- name: "π§° Install Protoc" | |
run: sudo apt install protobuf-compiler | |
- name: "π§° Install dependencies" | |
run: | | |
python -m pip install --upgrade pip | |
pip install . | |
pip install .[tests] | |
- name: "π Lint Python code" | |
run: pylint -E archive_query_log | |
unit-tests: | |
name: "π§ͺ Python unit tests" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "π₯ Check-out" | |
uses: actions/checkout@v3 | |
- name: "π§° Install Python" | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: pip | |
cache-dependency-path: pyproject.toml | |
- name: "π§° Install Protoc" | |
run: sudo apt install protobuf-compiler | |
- name: "π§° Install dependencies" | |
run: | | |
python -m pip install --upgrade pip | |
pip install . | |
pip install .[tests] | |
- name: "π§ͺ Test Python code" | |
run: pytest --cov=./ --cov-report=xml --capture=no archive_query_log/ | |
- name: "π€ Upload coverage to Codecov" | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
release: | |
name: "π Create GitHub release" | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
needs: | |
- code-format | |
- lint | |
- unit-tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: "π₯ Check-out" | |
uses: actions/checkout@v3 | |
- name: "π·οΈ Get version tag" | |
id: get-version | |
run: echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//} | |
- name: "π₯ Download Python wheel" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheel | |
path: dist/* | |
- name: "π Create GitHub release" | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Release ${{ steps.get-version.outputs.tag }} | |
files: dist/* | |
fail_on_unmatched_files: true | |
draft: false | |
prerelease: false | |
generate_release_notes: true |