Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 50 additions & 30 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,31 @@ on:
- "install_secp256k1.sh"

jobs:
check-run:
# continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
# All of these options are optional, so you can remove them if you are happy with the defaults
concurrent_skipping: 'same_content_newer'
skip_after_successful_duplicate: 'true'
do_not_skip: '["workflow_dispatch", "schedule"]'

build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
fail-fast: true

needs:
- check-run
if: needs.check-run.outputs.should_skip != 'true'

steps:
- uses: actions/checkout@v5

Expand All @@ -44,56 +61,59 @@ jobs:
echo "/usr/local/lib" >> $GITHUB_PATH
echo "LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV

- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Install project
run: uv sync --dev

- name: Install secp256k1-py
run: pip install python-secp256k1-cardano
run: uv pip install python-secp256k1-cardano

- name: Verify secp256k1 installation
run: |
python -c "import pysecp256k1; print('secp256k1 installed successfully')"
uv run python -c "import pysecp256k1; print('secp256k1 installed successfully')"

- name: Install dependencies
run: |
pip install -U poetry
poetry install --with dev --all-extras

- name: Run tests and coverage
run: |
poetry run black --check .
poetry run coverage run --source=uplc -m pytest tests
poetry run coverage run -a --source=uplc -m uplc --help
poetry run coverage run -a --source=uplc -m uplc parse examples/fibonacci.uplc
poetry run coverage run -a --source=uplc -m uplc dump examples/fibonacci.uplc --dialect legacy-aiken
poetry run coverage run -a --source=uplc -m uplc dump examples/fibonacci.uplc --dialect plutus --unique-varnames
poetry run coverage run -a --source=uplc -m uplc eval examples/fibonacci.uplc "(con integer 5)"
poetry run coverage run -a --source=uplc -m uplc build examples/fibonacci.uplc
poetry run coverage run -a --source=uplc -m uplc build examples/fibonacci.uplc -fconstant-folding
poetry run coverage run -a --source=uplc -m uplc build examples/fibonacci.uplc -fremove-force-delay
poetry run coverage run -a --source=uplc -m uplc build examples/fibonacci.uplc -fdeduplicate
poetry run coverage run -a --source=uplc -m uplc build examples/fibonacci.uplc -ffold-apply-lambda-increase 1.2
poetry run coverage run -a --source=uplc -m uplc build examples/fibonacci.uplc -O0
poetry run coverage run -a --source=uplc -m uplc build examples/fibonacci.uplc -O1
poetry run coverage run -a --source=uplc -m uplc build examples/fibonacci.uplc -O2
poetry run coverage run -a --source=uplc -m uplc build examples/fibonacci.uplc -O3
poetry run coverage run -a --source=uplc -m uplc dump build/fibonacci/script.cbor --from-cbor
uv run black --check .
uv run coverage run --source=uplc -m uplc --help
uv run coverage run --source=uplc -m pytest tests
uv run coverage run -a --source=uplc -m uplc parse examples/fibonacci.uplc
uv run coverage run -a --source=uplc -m uplc dump examples/fibonacci.uplc --dialect legacy-aiken
uv run coverage run -a --source=uplc -m uplc dump examples/fibonacci.uplc --dialect plutus --unique-varnames
uv run coverage run -a --source=uplc -m uplc eval examples/fibonacci.uplc "(con integer 5)"
uv run coverage run -a --source=uplc -m uplc build examples/fibonacci.uplc
uv run coverage run -a --source=uplc -m uplc build examples/fibonacci.uplc -fconstant-folding
uv run coverage run -a --source=uplc -m uplc build examples/fibonacci.uplc -fremove-force-delay
uv run coverage run -a --source=uplc -m uplc build examples/fibonacci.uplc -fdeduplicate
uv run coverage run -a --source=uplc -m uplc build examples/fibonacci.uplc -ffold-apply-lambda-increase 1.2
uv run coverage run -a --source=uplc -m uplc build examples/fibonacci.uplc -O0
uv run coverage run -a --source=uplc -m uplc build examples/fibonacci.uplc -O1
uv run coverage run -a --source=uplc -m uplc build examples/fibonacci.uplc -O2
uv run coverage run -a --source=uplc -m uplc build examples/fibonacci.uplc -O3
uv run coverage run -a --source=uplc -m uplc dump build/fibonacci/script.cbor --from-cbor

- name: Upload coverage data to coveralls.io
run: |
pip install coveralls
coveralls || true
uv pip install coveralls
uv run coveralls || true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.python-version }}
COVERALLS_PARALLEL: true

coveralls:
name: Indicate completion to coveralls.io
needs: [build]
if: always()
needs:
- check-run
- build
if: needs.check-run.outputs.should_skip != 'true'
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Install coveralls
run: pip3 install --upgrade coveralls
run: pip install --upgrade coveralls
- name: Finished
run: coveralls --finish || true
env:
Expand Down
24 changes: 16 additions & 8 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,26 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
# Build and publish the package to pypi.
- name: Build and publish to pypi
uses: JRubics/poetry-publish@v2.1
with:
python_version: "3.13"
pypi_token: ${{ secrets.PYPI_PASSWORD }}
package_directory: "uplc"
poetry_install_options: "--without dev"
# If there isn't a release for this version, create a new one.
- uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true
makeLatest: true
prerelease: false
skipIfReleaseExists: true
# Build and publish the package to pypi.
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"

- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Build and publish to PyPI
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_PASSWORD }}
run: |
uv sync
uv build
uv publish
Loading