Skip to content

Commit

Permalink
Merge pull request #550 from doorstop-dev/remove-graphviz
Browse files Browse the repository at this point in the history
Remove Graphviz dependency from CI jobs
  • Loading branch information
jacebrowning committed Mar 4, 2022
2 parents 0f8cd0c + f97f986 commit bc3323f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 44 deletions.
53 changes: 10 additions & 43 deletions .github/workflows/execute-tests.yml
@@ -1,9 +1,6 @@
name: Execute tests

# This workflow is a reusable workflow. That is defined here.
on:
workflow_call:
# Require calling workflows to set variables that are OS dependent.
inputs:
architecture:
required: true
Expand All @@ -18,36 +15,25 @@ on:
required: true
type: string

# Define the jobs.
jobs:
# Execute tests.
test:
# Set which OS is used.
runs-on: ${{ inputs.os }}
# Define all python versions to test.
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9"]
name: Python ${{ matrix.python-version }}

# Set the default working directory.
defaults:
run:
working-directory: ${{ inputs.workpath }}

# Define all job steps.
steps:
# Use a manual checkout.
- name: Checkout *nix
- name: Checkout Unix
if: ${{ inputs.os != 'windows-latest' }}
run: |
mkdir -p ${{ inputs.workpath }}
git clone https://github.com/${{ github.repository }} ${{ inputs.workpath }} --depth 1 --branch $GITHUB_REF_NAME
# Use a manual checkout to force C: to be used on Windows. Otherwise some
# tests will fail due to default checkout is on D: while temporary paths
# are on C:.
- name: Checkout Windows
# Cannot start powershell from a path that does not exist, so change
# working directory for this step only.
Expand All @@ -57,48 +43,29 @@ jobs:
mkdir -p ${{ inputs.workpath }}
git clone https://github.com/${{ github.repository }} ${{ inputs.workpath }} --depth 1 --branch $env:GITHUB_REF_NAME
# Create the matrix to test all defined python versions.
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ inputs.architecture }}

# Install poetry.
- name: Install Poetry
run: pip install poetry

#####################################
# Install graphviz depending on OS. #
#####################################
# macOS
- name: Install Graphviz (macOS)
if: ${{ inputs.os == 'macos-latest' }}
run: brew install graphviz

# Linux
- name: Install Graphviz (Linux)
if: ${{ inputs.os == 'ubuntu-latest' }}
run: sudo apt install graphviz

# Windows
- name: Install Graphviz (Windows)
if: ${{ inputs.os == 'windows-latest' }}
run: choco install graphviz
#####################################
# Done graphviz depending on OS. #
#####################################
- uses: Gr1N/setup-poetry@v7

- name: Check system dependencies
run: make doctor

- uses: actions/cache@v2
with:
path: .venv
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}

- name: Install project dependencies
run: make install

- name: Run checks
run: make check

- name: Run tests
run: make test

- name: Run checks
run: make check

- name: Run demo
run: make demo
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -68,7 +68,7 @@ format: install
.PHONY: check
check: install format ## Run formaters, linters, and static analysis
ifdef CI
git diff --exit-code
git diff --exit-code -- '***.py'
endif
poetry run mypy $(PACKAGES) --config-file=.mypy.ini
poetry run pylint $(PACKAGES) --rcfile=.pylint.ini
Expand Down

0 comments on commit bc3323f

Please sign in to comment.