Skip to content

Commit

Permalink
fix: gh actions workflow
Browse files Browse the repository at this point in the history
- disables pip auto version check
- installs project in editable
- move env and permissions to individual job scope
- use `.venv/bin` instead of `.venv/Scripts` in Linux
  • Loading branch information
yozachar committed Aug 7, 2023
1 parent 8fb3bf7 commit 1efff38
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ concurrency:
cancel-in-progress: false
env:
BUILD_PATH: "."
PIP_DISABLE_PIP_VERSION_CHECK: 1
jobs:
build:
name: Build
Expand All @@ -28,7 +29,9 @@ jobs:
python-version: "3.11"
# building
- name: Install 'documentation' dependencies
run: pip install -r python/requirements.mkdocs.txt
run: |
pip install .
pip install -r python/requirements.mkdocs.txt
- name: Build documentation
run: python src/export docs
# set up Pages
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ permissions:
contents: read
env:
BUILD_PATH: "."
PIP_DISABLE_PIP_VERSION_CHECK: 1
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -24,13 +25,13 @@ jobs:
- name: Install dependencies
run: |
python -m venv .venv
./.venv/Scripts/python -m pip install --upgrade pip
./.venv/Scripts/pip install .
./.venv/Scripts/pip install -r python/requirements.sphinx.txt
./.venv/Scripts/pip install build
./.venv/bin/python -m pip install --upgrade pip
./.venv/bin/pip install .
./.venv/bin/pip install -r python/requirements.sphinx.txt
./.venv/bin/pip install build
# build package
- name: Build package
run: ./.venv/Scripts/python src/export package
run: ./.venv/bin/python src/export package
# upload package as artifact
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/pycqa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
branches: [master]
pull_request:
branches: [master]
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
jobs:
tooling:
runs-on: ubuntu-latest
Expand All @@ -20,7 +22,9 @@ jobs:
python-version: "3.8"
# tooling
- name: Install 'tooling' dependencies
run: pip install -r python/requirements.tooling.txt
run: |
pip install .
pip install -r python/requirements.tooling.txt
- name: Tooling
run: |
black .
Expand Down
2 changes: 1 addition & 1 deletion src/export/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def package(source: Path):
generate_documentation(source, only_rst_man=True)
# print()
if getenv("CI", "false") == "true":
process = Popen(("./venv/Scripts/python", "-m", "build"), shell=False) # nosec
process = Popen(("./venv/bin/python", "-m", "build"), shell=False) # nosec
else:
process = Popen(("pdm", "build"), shell=False) # nosec
process.communicate()
Expand Down

0 comments on commit 1efff38

Please sign in to comment.