Skip to content

Commit

Permalink
Test with different package names (#121)
Browse files Browse the repository at this point in the history
* Test with different package names

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Uses `project-name`

* oops

* specify overrides

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
flying-sheep and pre-commit-ci[bot] authored Nov 20, 2022
1 parent 102e03c commit 4a894ef
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,33 @@ jobs:
matrix:
python: ["3.8", "3.10"]
os: [ubuntu-latest]
# one that matches "project-name".lower().replace('-', '_'), one that doesn’t:
package-name: [project_name, package_alt]
env:
PROJECT_ROOT: project-name

steps:
# Setup
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

cache: "pip"
cache-dependency-path: "**/pyproject.toml"
- name: Install Ubuntu system dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install pandoc
- name: Get pip cache dir
id: pip-cache-dir
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Restore pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache-dir.outputs.dir }}
key: pip-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
pip-${{ runner.os }}-${{ env.pythonLocation }}-
- name: Install dependencies
run: sudo apt-get install pandoc
- name: Install build & check dependencies
run: python -m pip install --upgrade pip wheel cookiecutter pre-commit
# Build
- name: Build from template
run: cookiecutter --no-input .
shell: python
run: |
from cookiecutter.main import cookiecutter
overrides = dict(package_name='${{ matrix.package-name }}')
cookiecutter('.', no_input=True, extra_context=overrides)
# Check
- name: Run pre-commit
run: |
cd "$PROJECT_ROOT"
Expand All @@ -57,7 +54,8 @@ jobs:
run: |
cd $PROJECT_ROOT
pip install ".[doc]"
python -c "import project_name"
python -c "import ${{ matrix.package-name }}"
# Docs
- name: Build the documentation
env:
SPHINXOPTS: -W --keep-going
Expand Down

0 comments on commit 4a894ef

Please sign in to comment.