Skip to content

Merge pull request #186 from expectedparrot/docs325 #272

Merge pull request #186 from expectedparrot/docs325

Merge pull request #186 from expectedparrot/docs325 #272

name: Build Package From Source
# Build package from source (without pip install)
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
env:
OPENAI_API_KEY: ${{ secrets.FAKE_API_KEY }}
GOOGLE_API_KEY: ${{ secrets.FAKE_API_KEY }}
DEEP_INFRA_API_KEY: ${{ secrets.FAKE_API_KEY }}
POETRY_VERSION: "1.7.1"
jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
matrix:
os: [ubuntu-latest, windows-latest, 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"