compose-viz/.github/workflows/ci.yml
2022-05-25 17:16:38 +08:00

54 lines
1.6 KiB
YAML

name: CI
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]
jobs:
test:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Switch to Current Branch
run: git checkout ${{ env.BRANCH }}
- run: |
sudo apt-get update
sudo apt-get install -y graphviz
- name: Validate Test Files
run: |
docker compose -f tests/ymls/builds/docker-compose.yml config -q
docker compose -f tests/ymls/depends_on/docker-compose.yml config -q
docker compose -f tests/ymls/extends/docker-compose.yml config -q
docker compose -f tests/ymls/links/docker-compose.yml config -q
docker compose -f tests/ymls/networks/docker-compose.yml config -q
docker compose -f tests/ymls/ports/docker-compose.yml config -q
docker compose -f tests/ymls/volumes/docker-compose.yml config -q
docker compose -f examples/full-stack-node-app/docker-compose.yml config -q
- name: Setup Python 3.10.4
uses: actions/setup-python@v3
with:
python-version: '3.10.4'
- name: Setup Poetry
uses: Gr1N/setup-poetry@v7
with:
poetry-version: 1.1.7
- name: Install Dependencies
run: |
poetry install --no-root
- name: Execute pre-commit
run: |
poetry run python -m pre_commit run --all-files --show-diff-on-failure
- name: Run Pytest
run: |
poetry run python -m pytest --cov=compose_viz tests/ --tb=short