Merge pull request #1056 from expectedparrot/nb_deletes #1485
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Package From Source | |
# Build package from source (without pip install) | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
env: | |
POETRY_VERSION: "1.7.1" | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 15 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
exclude: | |
- os: macos-latest | |
python-version: "3.9" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Check commit count | |
shell: bash | |
id: check_commit_count | |
run: | | |
commit_count=$(git log --oneline | wc -l) | |
echo "Commit count: $commit_count" | |
if [ $(($commit_count % 1)) -eq 0 ]; then | |
echo "run_build_test=true" >> $GITHUB_ENV | |
fi | |
- if: env.run_build_test == 'true' | |
name: Set up python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- if: env.run_build_test == 'true' | |
name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: ${{ env.POETRY_VERSION }} | |
- if: env.run_build_test == 'true' | |
name: Install deps | |
shell: bash | |
run: poetry install | |
- if: env.run_build_test == 'true' | |
name: Build | |
shell: bash | |
run: poetry build | |
- if: env.run_build_test == 'true' | |
name: Test installing built package | |
shell: bash | |
run: python -m pip install . | |
- if: env.run_build_test == 'true' | |
name: Test import | |
shell: bash | |
working-directory: ${{ vars.RUNNER_TEMP }} | |
run: python -c "import edsl" |