29 feat apply changes to use workflow pipelines270 #54
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: Continuous Integration | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- "**" | |
paths-ignore: | |
- "docs/**" | |
types: | |
- ready_for_review | |
- synchronize | |
jobs: | |
pre-commit: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.10"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- | |
name: Checking out repository | |
uses: actions/checkout@v2 | |
- | |
name: Setting up python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- | |
uses: pre-commit/[email protected] | |
tests: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.10"] | |
runs-on: ${{ matrix.os }} | |
needs: pre-commit | |
steps: | |
- | |
name: Checking out repository | |
uses: actions/checkout@v2 | |
- | |
name: Installing poetry | |
run: | | |
pipx install poetry | |
- | |
name: Setting up python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'poetry' | |
- | |
name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- | |
name: Run services | |
run: | | |
docker-compose -f docker-compose-tutorial.yml up -d --build | |
- | |
name: Installing workflow dependencies | |
run: | | |
poetry install | |
- | |
name: Set workspace for testing | |
run: | | |
poetry run workflow workspace set development | |
- | |
name: Run workflow tests | |
run: | | |
poetry run pytest --cov . --cov-report=lcov -s -v | |
- | |
name: Upload coverage report | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: "coverage.lcov" | |
- | |
name: Kill services | |
if: always() | |
run: | | |
docker-compose -f docker-compose-tutorial.yml down -v |