Skip to content

Commit

Permalink
break up and parallize arbiter work flow
Browse files Browse the repository at this point in the history
forge test
solidity
dependabot
toolchain version
book tests and dependancies
version warning migration
book lint
dependancy CI
remove book deploy
clippy
codespell, fmt
  • Loading branch information
0xJepsen committed Oct 23, 2023
1 parent 42f48a0 commit 51ef628
Show file tree
Hide file tree
Showing 20 changed files with 238 additions and 217 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "daily"

- package-ecosystem: "cargo"
directory: "arbiter-core"
schedule:
interval: "daily"
110 changes: 35 additions & 75 deletions .github/workflows/book.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,121 +12,81 @@ on:
merge_group:

jobs:
test:

install:
runs-on: ubuntu-latest
name: test
name: Install

steps:
- uses: actions/checkout@v3

- name: Install mdbook
run: |
cd journal
mkdir mdbook
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.14/mdbook-v0.4.14-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Install mdbook-template
run: |
cd journal
mkdir mdbook-template
curl -sSL https://github.com/sgoudham/mdbook-template/releases/latest/download/mdbook-template-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook-template
echo `pwd`/mdbook-template >> $GITHUB_PATH
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.73.0
override: true

- name: Install mdbook-katex
run: |
cargo install mdbook-katex
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
test:
runs-on: ubuntu-latest
needs: Install
name: Test

steps:
- uses: actions/checkout@v3
- name: Run tests
run: mdbook test
run: |
cd journal
mdbook test
lint:
runs-on: ubuntu-latest
name: lint

name: Lints
needs: Install
steps:
- uses: actions/checkout@v3

- name: Install mdbook-linkcheck
run: |
cd journal
mkdir mdbook-linkcheck
curl -sSL -o mdbook-linkcheck.zip https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/latest/download/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip
unzip mdbook-linkcheck.zip -d ./mdbook-linkcheck
chmod +x `pwd`/mdbook-linkcheck/mdbook-linkcheck
echo `pwd`/mdbook-linkcheck >> $GITHUB_PATH
- name: Run linkcheck
run: mdbook-linkcheck --standalone
run: |
cd journal
mdbook-linkcheck --standalone
build:
runs-on: ubuntu-latest
needs: Install
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- name: Install mdbook
run: |
mkdir mdbook
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.14/mdbook-v0.4.14-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Install mdbook-template
run: |
mkdir mdbook-template
curl -sSL https://github.com/sgoudham/mdbook-template/releases/latest/download/mdbook-template-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook-template
echo `pwd`/mdbook-template >> $GITHUB_PATH

- name: Build book
run: mdbook build documentation

- name: Build docs
run: RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo +nightly doc --all --no-deps

- name: Move docs to book folder
run: |
mkdir -p target/book/docs
mv target/doc documentation/book/docs
- name: Archive artifact
shell: sh
run: |
chmod -c -R +rX "documentation/book" |
while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
tar \
--dereference --hard-dereference \
--directory "documentation/book" \
-cvf "$RUNNER_TEMP/artifact.tar" \
--exclude=.git \
--exclude=.github \
.
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: github-pages
path: ${{ runner.temp }}/artifact.tar
retention-days: 1
if-no-files-found: error

deploy:
# Only deploy if a push to main
if: github.ref_name == 'main' && github.event_name == 'push'
runs-on: ubuntu-latest
needs: [test, lint, build]

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
run: RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo +nightly doc --all --no-deps
67 changes: 0 additions & 67 deletions .github/workflows/lint.yaml

This file was deleted.

123 changes: 123 additions & 0 deletions .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Rust

on: push

jobs:
checkout:
name: Checkout Code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/checkout@v3
with:
submodules: recursive

install-rust:
name: Install Rust Toolchain
runs-on: ubuntu-latest
steps:
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.73.0
override: true

install-foundry:
name: Install Foundry
runs-on: ubuntu-latest
needs: install-rust
steps:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
components: rustfmt, clippy

install-arbiter:
name: Install Arbiter
runs-on: ubuntu-latest
needs: [install-rust]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install arbiter
run: cargo install arbiter

generate-bindings:
name: Generate Bindings
runs-on: ubuntu-latest
needs: install-arbiter
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Generate Bindings
run: arbiter bind

- name: List directory structure
run: ls -R

- name: Move Bindings
run: |
mv ./src/bindings/* ./simulation/src/bindings/
run-tests:
name: Run Tests
runs-on: ubuntu-latest
needs: generate-bindings
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: test
run: cargo test --workspace --exclude bindings

fmt:
name: fmt
runs-on: ubuntu-latest
needs: generate-bindings
steps:
- uses: actions/checkout@v3

- name: cargo fmt
run: cargo +nightly fmt --all -- --check

clippy:
name: clippy
runs-on: ubuntu-latest
needs: generate-bindings
steps:
- uses: actions/checkout@v3

- name: cargo clippy
run: cargo clippy --all --all-features -- -A non_snake_case -D warnings

udeps:
name: udeps
runs-on: ubuntu-latest
needs: generate-bindings
steps:
- uses: actions/checkout@v3

- name: install udeps
run: cargo install --git https://github.com/est31/cargo-udeps --locked
- name: cargo udeps
run: cargo +nightly udeps

codespell:
name: codespell
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run CodeSpell
uses: codespell-project/[email protected]
with:
check_hidden: true
check_filenames: true
skip: .git,Cargo.lock,target
ignore_words_list: crate,Crate,functio
21 changes: 21 additions & 0 deletions .github/workflows/solidity.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on: [push]

name: Solidity

jobs:
check:
name: Forge Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Run tests
run: forge test -vvv

- name: Run snapshot
run: forge snapshot
Loading

0 comments on commit 51ef628

Please sign in to comment.