Skip to content

ci

ci #107

Workflow file for this run

name: GenVM
on:
push:
paths-ignore:
- doc/**
- shell.nix
- '*.md'
branches:
- '*'
tags-ignore:
- v*
defaults:
run:
shell: bash -x {0}
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get source
uses: ./.github/actions/get-src
with:
install_also: --rust
- uses: actions/setup-python@v5
with:
python-version: 3.12
cache: pip
- name: configure and run codegen
run: |
cd "$GITHUB_WORKSPACE" && ./tools/ya-build/ya-build config && \
ninja -v -C build tags/codegen
- uses: pre-commit/[email protected]
### MODULE TESTS
module-test-cargo:
needs: [pre-commit]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get source
uses: ./.github/actions/get-src
with:
install_also: --rust
- name: configure and run codegen
run: |
cd "$GITHUB_WORKSPACE" && ./tools/ya-build/ya-build config && \
ninja -v -C build tags/codegen
- name: check format
run: |
./build-scripts/cargo-fmt.sh && \
git diff -U1 --exit-code
- name: cargo test
run: |
./build-scripts/cargo-test.sh
module-test-python:
needs: [pre-commit]
runs-on: ubuntu-latest
steps:
- run: sudo apt-get install -y python3-poetry
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: poetry
- name: Get source
uses: ./.github/actions/get-src
with:
load_submodules: "false"
- name: install dependencies
run: |
python3.12 -m pip install poetry && \
pushd runners/genlayer-py-std && \
poetry install && \
popd
- name: pytest
run: |
pushd runners/genlayer-py-std && \
poetry run pytest -n auto && \
popd
### RUNNERS
build-runners:
runs-on: ubuntu-latest
needs: [pre-commit]
outputs:
url: ${{ steps.artifact-upload-step.outputs.artifact-url }}
steps:
- uses: actions/checkout@v4
- name: Get source
uses: ./.github/actions/get-src
with:
install_also: --wasi --rust
third_party: sdk-rust/third-party/wasi-rs runners/softfloat/berkeley-softfloat-3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v4
with:
save-always: true
path: /tmp/.buildx-cache
key: runners-buildx-${{ github.sha }}
restore-keys: |
runners-buildx-
- name: Configure
run: |
source env.sh && \
ya-build config
- name: Build extension
run: |
source env.sh && \
ninja --verbose -C build genvm/runners/cpython/extension && \
git diff -U1 --exit-code
- name: Build
run: |
source env.sh && \
ninja --verbose -C build tags/runner && \
tree build/out && \
pushd build/out && \
zip -r -9 ../runners.zip * && \
popd
- name: Publish runners
id: artifact-upload-step
uses: actions/upload-artifact@v4
with:
name: runners
path: ${{ github.workspace }}/build/runners.zip
### GENVMS build
build-genvm-debug-ubuntu-latest:
needs: [module-test-cargo, module-test-python]
uses: ./.github/workflows/genvm-build-template.yaml
with:
build_type: debug
runs_on: ubuntu-latest
# build-genvm-release-ubuntu-latest:
# needs: []
# uses: ./.github/workflows/genvm-build-template.yaml
# with:
# build_type: release
# runs_on: ubuntu-latest
# build-genvm-release-macos-latest:
# needs: [module-test-cargo, module-test-python]
# uses: ./.github/workflows/genvm-build-template.yaml
# with:
# build_type: release
# runs_on: macos-latest
### GENVMS test
test-genvm-debug-ubuntu-latest:
needs: [build-runners, build-genvm-debug-ubuntu-latest]
uses: ./.github/workflows/genvm-test-template.yaml
with:
runs_on: ubuntu-latest
# based on genvm-${{ inputs.build_type }}-${{ inputs.runs_on }}
# ${{ needs.test-genvm-debug-ubuntu-latest.outputs.art-name }} doesn't work
genvm_artifact_name: genvm-debug-ubuntu-latest
secrets: inherit
# test-genvm-release-ubuntu-latest:
# needs: [build-runners, build-genvm-release-ubuntu-latest]
# uses: ./.github/workflows/genvm-test-template.yaml
# with:
# runs_on: ubuntu-latest
# genvm_artifact_name: ${{ needs.test-genvm-release-ubuntu-latest.outputs.art-name }}
# test-genvm-release-macos-latest:
# needs: [build-runners, build-genvm-release-macos-latest]
# uses: ./.github/workflows/genvm-test-template.yaml
# with:
# runs_on: macos-latest
# genvm_artifact_name: ${{ needs.test-genvm-release-macos-latest.outputs.art-name }}