Skip to content

Draft: add polymorphic const parameters #1647

Draft: add polymorphic const parameters

Draft: add polymorphic const parameters #1647

Workflow file for this run

name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download Git submodules
run: git submodule update --init --recursive
- uses: coq-community/docker-coq-action@v1
with:
custom_image: coqorg/coq:8.17-ocaml-4.14-flambda
custom_script: |
startGroup "Install dependencies"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
cargo --version
sudo ln -s `which python3` /usr/bin/python
opam install -y --deps-only CoqOfRust/coq-of-rust.opam
endGroup
startGroup "Build"
sudo chown -R $(whoami) .
cargo build --verbose
endGroup
startGroup "Install"
cargo install --path lib/
endGroup
startGroup "Format check"
cargo fmt --check
endGroup
startGroup "Lint"
cargo clippy --all-targets --all-features -- -D warnings
endGroup
startGroup "Translate Rust examples"
python run_tests.py
endGroup
startGroup "Pre-process the smart contracts"
cd contracts
python source_to_generated.py
cd generated
for dir in * ; do cd $dir ; cargo check ; cd .. ; done
cd ../..
endGroup
# We disable for now this translation as this makes a panic!
# startGroup "Translate Ink! library"
# cd CoqOfRust
# ./generate_ink_example.sh
# cd ..
# endGroup
startGroup "Check that the diff is empty"
git -c color.ui=always diff --exit-code
endGroup
startGroup "Compile Coq translations"
cd CoqOfRust
python ./make_and_detect_warnings.py
cd ..
endGroup