From 7aa119ed3ed2c576510a3b64a5b7ca8c9833cfa9 Mon Sep 17 00:00:00 2001 From: Shuhui Luo <107524008+shuhuiluo@users.noreply.github.com> Date: Sat, 20 Jul 2024 02:59:04 -0700 Subject: [PATCH] fix ci --- .github/workflows/default-setup.yml | 63 +++++++++++++++-------------- .github/workflows/rust.yml | 3 ++ 2 files changed, 35 insertions(+), 31 deletions(-) diff --git a/.github/workflows/default-setup.yml b/.github/workflows/default-setup.yml index fce9c39..090d8a1 100644 --- a/.github/workflows/default-setup.yml +++ b/.github/workflows/default-setup.yml @@ -6,39 +6,40 @@ on: cache-key: description: "Cache key" value: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }} - jobs: - setup: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - name: Use Node.js 20.x - uses: actions/setup-node@v4 - with: - node-version: 20.x - cache: "yarn" - cache-dependency-path: "yarn.lock" +jobs: + setup: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive - - name: Install dependencies 📦 - run: yarn install --frozen-lockfile + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: "yarn" + cache-dependency-path: "yarn.lock" - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - with: - version: nightly + - name: Install dependencies 📦 + run: yarn install --frozen-lockfile - - name: Generate contract Rust bindings - run: yarn bind + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + with: + version: nightly - - name: Cache Cargo registry - uses: actions/cache@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }} - restore-keys: | - ${{ runner.os }}-cargo-registry- + - name: Generate contract Rust bindings + run: yarn bind + + - name: Cache Cargo registry + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }} + restore-keys: | + ${{ runner.os }}-cargo-registry- diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c3cde9a..fee4349 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -11,6 +11,9 @@ env: INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }} jobs: + setup: + uses: ./.github/workflows/default-setup.yml + lint: name: Lint needs: setup