Transfer to github actions #11
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: CI/CD | |
on: | |
push: | |
pull_request: | |
release: | |
types: [created] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.8', '3.9', '3.10', '3.11'] | |
fail-fast: true | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install secp256k1 | |
run: | | |
bash install_secp256k1.sh | |
echo "/usr/local/lib" >> $GITHUB_PATH | |
- name: Install dependencies | |
run: | | |
pip install -U poetry | |
poetry install --with dev | |
- name: Run tests and coverage | |
run: | | |
poetry run black --check . | |
poetry run coverage run --source=uplc -m pytest uplc/tests | |
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 -fremove-traces | |
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 -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 | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
- name: Publish to PyPI | |
if: github.event_name == 'release' && matrix.python-version == '3.10' | |
env: | |
PYPI_USERNAME: __token__ | |
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: | | |
poetry config pypi-token.pypi $PYPI_PASSWORD | |
poetry build | |
poetry publish |