Skip to content

Commit

Permalink
investigating CI failures with compile-all steps
Browse files Browse the repository at this point in the history
  • Loading branch information
achidlow committed Jan 10, 2025
1 parent 5f0dec0 commit 11f993e
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 81 deletions.
160 changes: 80 additions & 80 deletions .github/workflows/check-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,86 +5,86 @@ on:
pull_request:

jobs:
check-python:
runs-on: "ubuntu-latest"
steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "poetry"

- name: Install dependencies
run: poetry install --no-interaction --with cicd --with doc

- name: Check pre-commits
run: |
set -o pipefail
poetry run pre-commit run --all-files && git diff --exit-code
- name: Check generated code
run: |
set -o pipefail
poetry run poe gen && git diff --exit-code
- name: Check documentation
run: |
set -o pipefail
poetry run poe docs
- name: Check wheels can be built
run: |
set -o pipefail
# build stubs
pushd stubs
poetry build --format wheel
popd
# build compiler
poetry build --format wheel
tests:
runs-on: "ubuntu-latest"
steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "poetry"

- name: Install dependencies
run: poetry install --no-interaction --with cicd

- name: Start LocalNet
run: poetry run algokit localnet start

- name: pytest + coverage
shell: bash
env:
COVERAGE_CORE: sysmon
run: |
set -o pipefail
poetry run pytest --junitxml=pytest-junit.xml --cov | tee pytest-coverage.txt
- name: pytest coverage comment
continue-on-error: true # forks fail to add a comment, so continue any way
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest-junit.xml
# check-python:
# runs-on: "ubuntu-latest"
# steps:
# - name: Checkout source code
# uses: actions/checkout@v4
#
# - name: Install poetry
# run: pipx install poetry
#
# - name: Set up Python 3.12
# uses: actions/setup-python@v5
# with:
# python-version: "3.12"
# cache: "poetry"
#
# - name: Install dependencies
# run: poetry install --no-interaction --with cicd --with doc
#
# - name: Check pre-commits
# run: |
# set -o pipefail
# poetry run pre-commit run --all-files && git diff --exit-code
#
# - name: Check generated code
# run: |
# set -o pipefail
# poetry run poe gen && git diff --exit-code
#
# - name: Check documentation
# run: |
# set -o pipefail
# poetry run poe docs
#
# - name: Check wheels can be built
# run: |
# set -o pipefail
#
# # build stubs
# pushd stubs
# poetry build --format wheel
# popd
#
# # build compiler
# poetry build --format wheel
#
# tests:
# runs-on: "ubuntu-latest"
# steps:
# - name: Checkout source code
# uses: actions/checkout@v4
#
# - name: Install poetry
# run: pipx install poetry
#
# - name: Set up Python 3.12
# uses: actions/setup-python@v5
# with:
# python-version: "3.12"
# cache: "poetry"
#
# - name: Install dependencies
# run: poetry install --no-interaction --with cicd
#
# - name: Start LocalNet
# run: poetry run algokit localnet start
#
# - name: pytest + coverage
# shell: bash
# env:
# COVERAGE_CORE: sysmon
# run: |
# set -o pipefail
# poetry run pytest --junitxml=pytest-junit.xml --cov | tee pytest-coverage.txt
#
# - name: pytest coverage comment
# continue-on-error: true # forks fail to add a comment, so continue any way
# uses: MishaKav/pytest-coverage-comment@main
# with:
# pytest-coverage-path: ./pytest-coverage.txt
# junitxml-path: ./pytest-junit.xml

compile-all:
runs-on: "ubuntu-latest"
Expand Down
3 changes: 2 additions & 1 deletion scripts/compile_all_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ def checked_compile(p: Path, flags: list[str], *, out_suffix: str) -> Compilatio
env=ENV_WITH_NO_COLOR,
encoding="utf-8",
)
print(result.stdout)
bin_files_written = re.findall(r"info: Writing (.+\.bin)", result.stdout)

# normalize ARC-56 output
Expand Down Expand Up @@ -342,7 +343,7 @@ def main(options: CompileAllOptions) -> None:
for o in DEFAULT_OPTIMIZATION
if o in (options.optimization_level or DEFAULT_OPTIMIZATION)
]
with ProcessPoolExecutor() as executor:
with ProcessPoolExecutor(max_workers=1) as executor:
args = [(case, level) for level in opt_levels for case in to_compile]
for compilation_result, level in executor.map(_compile_for_level, args):
rel_path = compilation_result.rel_path
Expand Down

0 comments on commit 11f993e

Please sign in to comment.