From 4aa3fcb1e69005e39c54b454a13f08c956d456d9 Mon Sep 17 00:00:00 2001 From: Mathis Date: Fri, 17 Nov 2023 16:24:03 +0100 Subject: [PATCH] Add non-nix installation instructions (#765) * Add non-nix installation instructions * Enable building on PR to create workflow --- .../workflows/ubuntu-install-without-nix.yml | 27 ++++++++++++++ README.md | 1 + doc/ubuntu.md | 36 +++++++++++++++++++ rust-toolchain.toml | 4 +++ 4 files changed, 68 insertions(+) create mode 100644 .github/workflows/ubuntu-install-without-nix.yml create mode 100644 doc/ubuntu.md create mode 100644 rust-toolchain.toml diff --git a/.github/workflows/ubuntu-install-without-nix.yml b/.github/workflows/ubuntu-install-without-nix.yml new file mode 100644 index 0000000000..50f4337d59 --- /dev/null +++ b/.github/workflows/ubuntu-install-without-nix.yml @@ -0,0 +1,27 @@ +name: Ubuntu install without nix + +on: + schedule: + - cron: "0 0 * * MON" + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + + +jobs: + build: + runs-on: ubuntu-latest + container: + image: ubuntu:latest + steps: + - uses: actions/checkout@v4 + - name: Install and test + # Execute all lines that start with four spaces, and remove leading 'sudo ' + # because we're in a container and already root. + run: | + grep '^ ' doc/ubuntu.md \ + | sed 's/^ //' \ + | sed 's/^sudo //' \ + | bash -exo pipefail diff --git a/README.md b/README.md index 9eb25a58fe..d5f597c3ec 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ a dockerized Espresso Sequencer network with an example Layer 2 rollup applicati - Obtain code: `git clone git@github.com:EspressoSystems/espresso-sequencer`. - Make sure [nix](https://nixos.org/download.html) is installed. - Activate the environment with `nix-shell`, or `nix develop`, or `direnv allow` if using [direnv](https://direnv.net/). +- For installation without nix please see [ubuntu.md](./doc/ubuntu.md). ## Run the tests diff --git a/doc/ubuntu.md b/doc/ubuntu.md new file mode 100644 index 0000000000..a6cc3c5f50 --- /dev/null +++ b/doc/ubuntu.md @@ -0,0 +1,36 @@ +# Installing on ubuntu (without nix) + + + +## Install system dependencies + + sudo apt-get update + sudo apt-get install -y curl cmake pkg-config libssl-dev protobuf-compiler git + +## Install rustup + + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable + source $HOME/.cargo/env + +## Install foundry + + curl --proto '=https' --tlsv1.2 -sSf -L https://foundry.paradigm.xyz | bash + source $HOME/.bashrc + foundryup + +## Clone the repository + + git clone https://github.com/EspressoSystems/espresso-sequencer/ + cd espresso-sequencer + +## Run the rust tests + + export RUSTFLAGS='--cfg async_executor_impl="async-std" --cfg async_channel_impl="async-std"' + cargo test --release + +## Run the foundry tests + + cargo build --release --bin diff-test + export PATH=$PWD/target/release:$PATH + forge test -v + diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000000..2befdf6092 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "1.73.0" +components = [ "rustfmt", "llvm-tools-preview", "rust-src", "clippy" ] +profile = "minimal"