diff options
| author | Iwan Aucamp <aucampia@gmail.com> | 2021-11-26 00:07:08 +0100 |
|---|---|---|
| committer | Iwan Aucamp <aucampia@gmail.com> | 2021-11-26 00:07:08 +0100 |
| commit | c54adeda92fc8d683d5d0e183302bea0e07d32a0 (patch) | |
| tree | c688c64eaf275705c895cb38fc37c08162d3738e | |
| parent | 274cd1c2820e649450f74e4fbff9924305384c12 (diff) | |
| download | rdflib-c54adeda92fc8d683d5d0e183302bea0e07d32a0.tar.gz | |
Add GitHub actions workflow for validation
The workflow will run on windows, linux and macos.
Also:
- Limit berkeleydb in requirements.dev.txt to not install on windows as
currently this fails to install in the windows workflow.
- Fix .editorconfig for yaml
| -rw-r--r-- | .editorconfig | 4 | ||||
| -rw-r--r-- | .github/workflows/validate.yaml | 77 | ||||
| -rw-r--r-- | requirements.dev.txt | 2 |
3 files changed, 82 insertions, 1 deletions
diff --git a/.editorconfig b/.editorconfig index 774bb979..945fbabb 100644 --- a/.editorconfig +++ b/.editorconfig @@ -20,6 +20,10 @@ trim_trailing_whitespace = false [*.{js, py, pyi, toml, yml, yaml}] charset = utf-8 +[*.{yaml, yml}] +indent_style = space +indent_size = 2 + # 4 space indentation [*.py] indent_style = space diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml new file mode 100644 index 00000000..677d9cfb --- /dev/null +++ b/.github/workflows/validate.yaml @@ -0,0 +1,77 @@ +name: Validate + +on: [push, pull_request, workflow_dispatch] + +env: + FORCE_COLOR: 1 + XDG_CACHE_HOME: ${{ github.workspace }}/cache + +jobs: + validate: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + python-version: ["3.7", "3.8", "3.9"] + os: [ubuntu-latest, macos-latest, windows-latest] + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - uses: actions/setup-java@v2 + with: + distribution: "temurin" + java-version: "17" + + - name: Get pip cache dir + id: pip-cache + shell: bash + run: | + python -m ensurepip --upgrade + echo "::set-output name=dir::$(pip cache dir)" + - name: Cache pip + uses: actions/cache@v2 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: ${{ matrix.os }}-pip-${{ matrix.python-version }}-v1-${{ + hashFiles('**/setup.py', '**/requirements*.txt') }} + restore-keys: | + ${{ matrix.os }}-pip-${{ matrix.python-version }}-v1- + - name: Cache xdg + uses: actions/cache@v2 + with: + path: ${{ env.XDG_CACHE_HOME }} + key: ${{ matrix.os }}-xdg-v1-${{ hashFiles('**/with-fuseki.sh') }} + restore-keys: | + ${{ matrix.os }}-xdg-v1- + - name: Install dependencies + shell: bash + run: | + # bash .travis.fuseki_install_optional.sh + pip install --default-timeout 60 -r requirements.txt + if [ "${{ matrix.os }}" == "ubuntu-latest" ] + then + sudo apt-get install -y libdb-dev + elif [ "${{ matrix.os }}" == "macos-latest" ] + then + brew install berkeley-db@4 + export BERKELEYDB_DIR=$(brew --prefix berkeley-db@4) + fi + pip install --default-timeout 60 -r requirements.dev.txt + pip install networkx + python setup.py install + - name: Validate + shell: bash + run: | + black --config black.toml --check ./rdflib || true + flake8 --exit-zero rdflib + if [ "${{ matrix.os }}" == "windows-latest" ] + then + pytest -ra --cov + else + ./with-fuseki.sh pytest -ra --cov + fi diff --git a/requirements.dev.txt b/requirements.dev.txt index 3c361ef9..a42f20e3 100644 --- a/requirements.dev.txt +++ b/requirements.dev.txt @@ -1,4 +1,4 @@ -berkeleydb +berkeleydb; platform_system != "Windows" black==21.9b0 coverage doctest-ignore-unicode==0.1.2 |
