From a41f73f4bce64458e7b1f06b0730f74dce13745d Mon Sep 17 00:00:00 2001 From: Diego Date: Mon, 18 Nov 2024 12:22:25 -0500 Subject: [PATCH] Change CI to use `ubuntu-latest` --- .github/workflows/arbitrator-ci.yml | 32 ++-- .github/workflows/ci.yml | 22 +-- .github/workflows/codeql-analysis.yml | 212 +++++++++++++------------- .github/workflows/docker.yml | 2 +- .github/workflows/release-ci.yml | 34 ++--- .github/workflows/shellcheck-ci.yml | 2 +- 6 files changed, 152 insertions(+), 152 deletions(-) diff --git a/.github/workflows/arbitrator-ci.yml b/.github/workflows/arbitrator-ci.yml index 392eb876c0..a73d1eb124 100644 --- a/.github/workflows/arbitrator-ci.yml +++ b/.github/workflows/arbitrator-ci.yml @@ -6,29 +6,29 @@ on: inputs: enable_tmate: type: boolean - description: 'Enable tmate' + description: "Enable tmate" required: false default: false merge_group: pull_request: paths: - - 'arbitrator/**' - - 'contracts' - - '.github/workflows/arbitrator-ci.yml' - - 'Makefile' + - "arbitrator/**" + - "contracts" + - ".github/workflows/arbitrator-ci.yml" + - "Makefile" push: branches: - master env: RUST_BACKTRACE: 1 -# RUSTFLAGS: -Dwarnings # TODO: re-enable after wasmer upgrade + # RUSTFLAGS: -Dwarnings # TODO: re-enable after wasmer upgrade WABT_VERSION: 1.0.32 jobs: arbitrator: name: Run Arbitrator tests - runs-on: ubuntu-8 + runs-on: ubuntu-latest steps: - name: Setup tmate session uses: mxschmitt/action-tmate@v3 @@ -64,23 +64,23 @@ jobs: - name: Setup nodejs uses: actions/setup-node@v3 with: - node-version: '18' - cache: 'yarn' - cache-dependency-path: '**/yarn.lock' + node-version: "18" + cache: "yarn" + cache-dependency-path: "**/yarn.lock" - name: Install rust stable uses: dtolnay/rust-toolchain@stable with: - toolchain: 'stable' - components: 'llvm-tools-preview, rustfmt, clippy' + toolchain: "stable" + components: "llvm-tools-preview, rustfmt, clippy" - name: Install rust nightly uses: dtolnay/rust-toolchain@nightly id: install-rust-nightly with: - toolchain: 'nightly-2024-08-06' - targets: 'wasm32-wasi, wasm32-unknown-unknown' - components: 'rust-src, rustfmt, clippy' + toolchain: "nightly-2024-08-06" + targets: "wasm32-wasi, wasm32-unknown-unknown" + components: "rust-src, rustfmt, clippy" - name: Set STYLUS_NIGHTLY_VER environment variable run: echo "STYLUS_NIGHTLY_VER=+$(rustup toolchain list | grep '^nightly' | head -n1 | cut -d' ' -f1)" >> "$GITHUB_ENV" @@ -148,7 +148,7 @@ jobs: # This is the name of the cache folder. # The cache folder will be placed in the build directory, # so make sure it doesn't conflict with anything! - actions-cache-folder: 'emsdk-cache' + actions-cache-folder: "emsdk-cache" no-cache: true - name: Build cbrotli-wasm diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index acd6295b7c..e4d1daabf2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,14 +13,14 @@ on: jobs: test: name: Go Tests - runs-on: ubuntu-8 + runs-on: ubuntu-latest # Creates a redis container for redis tests services: redis: image: redis ports: - - 6379:6379 + - 6379:6379 strategy: fail-fast: false @@ -39,9 +39,9 @@ jobs: - name: Setup nodejs uses: actions/setup-node@v3 with: - node-version: '18' - cache: 'yarn' - cache-dependency-path: '**/yarn.lock' + node-version: "18" + cache: "yarn" + cache-dependency-path: "**/yarn.lock" - name: Install go uses: actions/setup-go@v4 @@ -56,17 +56,17 @@ jobs: - name: Install rust stable uses: dtolnay/rust-toolchain@stable with: - toolchain: 'stable' - targets: 'wasm32-wasi, wasm32-unknown-unknown' - components: 'llvm-tools-preview, rustfmt, clippy' + toolchain: "stable" + targets: "wasm32-wasi, wasm32-unknown-unknown" + components: "llvm-tools-preview, rustfmt, clippy" - name: Install rust nightly uses: dtolnay/rust-toolchain@nightly id: install-rust-nightly with: - toolchain: 'nightly-2024-08-06' - targets: 'wasm32-wasi, wasm32-unknown-unknown' - components: 'rust-src, rustfmt, clippy' + toolchain: "nightly-2024-08-06" + targets: "wasm32-wasi, wasm32-unknown-unknown" + components: "rust-src, rustfmt, clippy" - name: Set STYLUS_NIGHTLY_VER environment variable run: echo "STYLUS_NIGHTLY_VER=+$(rustup toolchain list | grep '^nightly' | head -n1 | cut -d' ' -f1)" >> "$GITHUB_ENV" diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 1cde8f06b9..170e300ecf 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -13,20 +13,20 @@ name: "CodeQL" on: push: - branches: [ "master" ] + branches: ["master"] merge_group: - branches: [ "master" ] + branches: ["master"] pull_request: # The branches below must be a subset of the branches above - branches: [ "master" ] + branches: ["master"] schedule: - - cron: '18 21 * * 5' + - cron: "18 21 * * 5" jobs: analyze: name: Analyze if: github.repository == 'OffchainLabs/nitro' # don't run in any forks without "Advanced Security" enabled - runs-on: ubuntu-8 + runs-on: ubuntu-latest permissions: actions: read contents: read @@ -37,108 +37,108 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'go' ] + language: ["go"] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: true - - - name: Install dependencies - run: sudo apt update && sudo apt install -y wabt - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - config-file: ./.github/codeql/codeql-config.yml - - - name: Setup nodejs - uses: actions/setup-node@v3 - with: - node-version: '18' - cache: 'yarn' - cache-dependency-path: '**/yarn.lock' - - - name: Install go - uses: actions/setup-go@v4 - with: - go-version: 1.21.x - - - name: Install rust stable - uses: dtolnay/rust-toolchain@stable - - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - - - name: Cache Rust Build Products - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry/ - ~/.cargo/git/ - arbitrator/target/ - arbitrator/wasm-libraries/target/ - arbitrator/wasm-libraries/soft-float/SoftFloat/build - target/etc/initial-machine-cache/ - key: ${{ runner.os }}-cargo-${{ steps.install-rust.outputs.rustc_hash }}-min-${{ hashFiles('arbitrator/Cargo.lock') }} - restore-keys: ${{ runner.os }}-cargo-${{ steps.install-rust.outputs.rustc_hash }}- - - - name: Cache wabt build - id: cache-wabt - uses: actions/cache@v3 - with: - path: ~/wabt-prefix - key: ${{ runner.os }}-wabt-codeql-${{ env.WABT_VERSION }} - - - name: Cache cbrotli - uses: actions/cache@v3 - id: cache-cbrotli - with: - path: | - target/include/brotli/ - target/lib-wasm/ - target/lib/libbrotlicommon-static.a - target/lib/libbrotlienc-static.a - target/lib/libbrotlidec-static.a - key: ${{ runner.os }}-brotli-3a-${{ hashFiles('scripts/build-brotli.sh') }}-${{ hashFiles('.github/workflows/arbitrator-ci.yaml') }} - restore-keys: ${{ runner.os }}-brotli- - - - name: Build cbrotli-local - if: steps.cache-cbrotli.outputs.cache-hit != 'true' - run: ./scripts/build-brotli.sh -l - - - name: Cache Build Products - uses: actions/cache@v3 - with: - path: | - ~/go/pkg/mod - ~/.cache/go-build - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-go- - - - name: Build all lint dependencies - run: make -j build-node-deps - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + + - name: Install dependencies + run: sudo apt update && sudo apt install -y wabt + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + config-file: ./.github/codeql/codeql-config.yml + + - name: Setup nodejs + uses: actions/setup-node@v3 + with: + node-version: "18" + cache: "yarn" + cache-dependency-path: "**/yarn.lock" + + - name: Install go + uses: actions/setup-go@v4 + with: + go-version: 1.21.x + + - name: Install rust stable + uses: dtolnay/rust-toolchain@stable + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + + - name: Cache Rust Build Products + uses: actions/cache@v3 + with: + path: | + ~/.cargo/registry/ + ~/.cargo/git/ + arbitrator/target/ + arbitrator/wasm-libraries/target/ + arbitrator/wasm-libraries/soft-float/SoftFloat/build + target/etc/initial-machine-cache/ + key: ${{ runner.os }}-cargo-${{ steps.install-rust.outputs.rustc_hash }}-min-${{ hashFiles('arbitrator/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo-${{ steps.install-rust.outputs.rustc_hash }}- + + - name: Cache wabt build + id: cache-wabt + uses: actions/cache@v3 + with: + path: ~/wabt-prefix + key: ${{ runner.os }}-wabt-codeql-${{ env.WABT_VERSION }} + + - name: Cache cbrotli + uses: actions/cache@v3 + id: cache-cbrotli + with: + path: | + target/include/brotli/ + target/lib-wasm/ + target/lib/libbrotlicommon-static.a + target/lib/libbrotlienc-static.a + target/lib/libbrotlidec-static.a + key: ${{ runner.os }}-brotli-3a-${{ hashFiles('scripts/build-brotli.sh') }}-${{ hashFiles('.github/workflows/arbitrator-ci.yaml') }} + restore-keys: ${{ runner.os }}-brotli- + + - name: Build cbrotli-local + if: steps.cache-cbrotli.outputs.cache-hit != 'true' + run: ./scripts/build-brotli.sh -l + + - name: Cache Build Products + uses: actions/cache@v3 + with: + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ runner.os }}-go- + + - name: Build all lint dependencies + run: make -j build-node-deps + + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2aacf32f00..ba6239b050 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -13,7 +13,7 @@ on: jobs: docker: name: Docker build - runs-on: ubuntu-8 + runs-on: ubuntu-latest services: # local registery registry: diff --git a/.github/workflows/release-ci.yml b/.github/workflows/release-ci.yml index 5282510e87..b7156cd303 100644 --- a/.github/workflows/release-ci.yml +++ b/.github/workflows/release-ci.yml @@ -6,25 +6,25 @@ on: jobs: build_and_run: - runs-on: ubuntu-8 + runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: recursive + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - driver-opts: network=host + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver-opts: network=host - - name: Cache Docker layers - uses: actions/cache@v3 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }} - restore-keys: ${{ runner.os }}-buildx- + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }} + restore-keys: ${{ runner.os }}-buildx- - - name: Startup Nitro testnode - run: ./scripts/startup-testnode.bash + - name: Startup Nitro testnode + run: ./scripts/startup-testnode.bash diff --git a/.github/workflows/shellcheck-ci.yml b/.github/workflows/shellcheck-ci.yml index d1c7b58580..987c528e2d 100644 --- a/.github/workflows/shellcheck-ci.yml +++ b/.github/workflows/shellcheck-ci.yml @@ -12,7 +12,7 @@ on: jobs: shellcheck: name: Run ShellCheck - runs-on: ubuntu-8 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4