diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 0868300..d8ac70b 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -10,8 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - + - name: Build and Publish to PyPi uses: JRubics/poetry-publish@v1.10 with: - pypi_token: ${{ secrets.PYPI_TOKEN }} \ No newline at end of file + pypi_token: ${{ secrets.PYPI_TOKEN }} + extra_build_dependency_packages: "graphviz" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c40e9d4..1577053 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,81 +12,31 @@ jobs: 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 + docker compose -f examples/non-normative/docker-compose.yml config -q + - name: Setup Python 3.10.4 uses: actions/setup-python@v3 with: python-version: '3.10.4' - - - name: Validate Test Files - run: | - docker-compose -f tests/in/000001.yaml config -q - docker-compose -f tests/in/000010.yaml config -q - docker-compose -f tests/in/000011.yaml config -q - docker-compose -f tests/in/000100.yaml config -q - docker-compose -f tests/in/000101.yaml config -q - docker-compose -f tests/in/000110.yaml config -q - docker-compose -f tests/in/000111.yaml config -q - docker-compose -f tests/in/001000.yaml config -q - docker-compose -f tests/in/001001.yaml config -q - docker-compose -f tests/in/001010.yaml config -q - docker-compose -f tests/in/001011.yaml config -q - docker-compose -f tests/in/001100.yaml config -q - docker-compose -f tests/in/001101.yaml config -q - docker-compose -f tests/in/001110.yaml config -q - docker-compose -f tests/in/001111.yaml config -q - docker-compose -f tests/in/010000.yaml config -q - docker-compose -f tests/in/010001.yaml config -q - docker-compose -f tests/in/010010.yaml config -q - docker-compose -f tests/in/010011.yaml config -q - docker-compose -f tests/in/010100.yaml config -q - docker-compose -f tests/in/010101.yaml config -q - docker-compose -f tests/in/010110.yaml config -q - docker-compose -f tests/in/010111.yaml config -q - docker-compose -f tests/in/011000.yaml config -q - docker-compose -f tests/in/011001.yaml config -q - docker-compose -f tests/in/011010.yaml config -q - docker-compose -f tests/in/011011.yaml config -q - docker-compose -f tests/in/011100.yaml config -q - docker-compose -f tests/in/011101.yaml config -q - docker-compose -f tests/in/011110.yaml config -q - docker-compose -f tests/in/011111.yaml config -q - docker-compose -f tests/in/100000.yaml config -q - docker-compose -f tests/in/100001.yaml config -q - docker-compose -f tests/in/100010.yaml config -q - docker-compose -f tests/in/100011.yaml config -q - docker-compose -f tests/in/100100.yaml config -q - docker-compose -f tests/in/100101.yaml config -q - docker-compose -f tests/in/100110.yaml config -q - docker-compose -f tests/in/100111.yaml config -q - docker-compose -f tests/in/101000.yaml config -q - docker-compose -f tests/in/101001.yaml config -q - docker-compose -f tests/in/101010.yaml config -q - docker-compose -f tests/in/101011.yaml config -q - docker-compose -f tests/in/101100.yaml config -q - docker-compose -f tests/in/101101.yaml config -q - docker-compose -f tests/in/101110.yaml config -q - docker-compose -f tests/in/101111.yaml config -q - docker-compose -f tests/in/110000.yaml config -q - docker-compose -f tests/in/110001.yaml config -q - docker-compose -f tests/in/110010.yaml config -q - docker-compose -f tests/in/110011.yaml config -q - docker-compose -f tests/in/110100.yaml config -q - docker-compose -f tests/in/110101.yaml config -q - docker-compose -f tests/in/110110.yaml config -q - docker-compose -f tests/in/110111.yaml config -q - docker-compose -f tests/in/111000.yaml config -q - docker-compose -f tests/in/111001.yaml config -q - docker-compose -f tests/in/111010.yaml config -q - docker-compose -f tests/in/111011.yaml config -q - docker-compose -f tests/in/111100.yaml config -q - docker-compose -f tests/in/111101.yaml config -q - docker-compose -f tests/in/111110.yaml config -q - docker-compose -f tests/in/111111.yaml config -q - + - name: Setup Poetry uses: Gr1N/setup-poetry@v7 with: @@ -96,6 +46,10 @@ jobs: run: | poetry install --no-root - - name: Validate Custom Input File + - name: Execute pre-commit run: | - poetry run python -m pytest + 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 diff --git a/.github/workflows/release-tagged-version.yml b/.github/workflows/release-tagged-version.yml index 3c6d547..f2ce249 100644 --- a/.github/workflows/release-tagged-version.yml +++ b/.github/workflows/release-tagged-version.yml @@ -18,15 +18,19 @@ jobs: 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: 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: @@ -34,7 +38,7 @@ jobs: - run: | poetry install --no-root poetry build - + - name: "Release Tagged Version" uses: "marvinpinto/action-automatic-releases@latest" with: @@ -42,4 +46,4 @@ jobs: prerelease: false files: | LICENSE - dist/** \ No newline at end of file + dist/** diff --git a/.gitignore b/.gitignore index fa94aa8..1fdfab5 100644 --- a/.gitignore +++ b/.gitignore @@ -158,4 +158,7 @@ cython_debug/ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ \ No newline at end of file +#.idea/ + +*.png +!examples/**/*.png diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..9b26d29 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,38 @@ +exclude: | + (?x)^( + README.md| + LICENSE| + tests/ymls/others/ + ) +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.2.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/pycqa/flake8 + rev: 4.0.1 + hooks: + - id: flake8 + args: + - "--max-line-length=120" + - repo: https://github.com/pycqa/isort + rev: 5.10.1 + hooks: + - id: isort + - repo: https://github.com/psf/black + rev: 22.3.0 + hooks: + - id: black + args: # arguments to configure black + - --line-length=120 + - repo: local + hooks: + - id: pyright + name: pyright + entry: pyright + language: node + pass_filenames: false + types: [python] + additional_dependencies: ['pyright@1.1.247'] diff --git a/README.md b/README.md index 060e486..e09d13d 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,8 @@
  • Getting Started