From 13f4f535a6b04c4ea056920e4b88f698c115d66c Mon Sep 17 00:00:00 2001 From: juanito87 Date: Fri, 2 Feb 2024 11:45:17 -0300 Subject: [PATCH] Updating all workflows --- .github/workflows/docker-tests.yml | 7 ++-- .github/workflows/release.yml | 1 - .github/workflows/rust.yml | 56 ++++++++++++++++++------------ 3 files changed, 36 insertions(+), 28 deletions(-) diff --git a/.github/workflows/docker-tests.yml b/.github/workflows/docker-tests.yml index 5bb06efd..11b49770 100644 --- a/.github/workflows/docker-tests.yml +++ b/.github/workflows/docker-tests.yml @@ -1,8 +1,6 @@ name: Docker tests on: - push: - branches: [ main ] pull_request: branches: [ main ] @@ -10,12 +8,11 @@ jobs: build: - runs-on: ubuntu-latest + runs-on: [self-hosted,"${{ matrix.os }}"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build the Docker images run: docker-tests/build-docker-images.sh - name: Run the Docker tests run: docker-tests/run-docker-tests.sh userspace - diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 172e6533..218790aa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,7 +43,6 @@ jobs: with: repository: rpcpool/innernet ref: "${{ env.innernetRef }}" - path: pathx submodules: recursive fetch-depth: 0 lfs: true diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9a871034..03768521 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -12,35 +12,44 @@ on: jobs: test: - runs-on: ${{ matrix.os }} + runs-on: [self-hosted,"${{ matrix.os }}"] strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-20.04, ubuntu-22.04] steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + + - name: get channel + run: | + echo "channel=$(cat rust-toolchain.toml | grep channel | awk '{print $3}' | sed 's/"//g')" >> "$GITHUB_ENV" + + - name: set cargo env + uses: dtolnay/rust-toolchain@master with: - profile: minimal - toolchain: stable - override: true + toolchain: ${{ env.channel }} + - name: Install Dependencies (if Ubuntu) env: ACCEPT_EULA: Y run: sudo apt-get -y update && sudo apt-get install -f && sudo apt-get -y install libsqlite3-dev libclang-11-dev if: contains(runner.os, 'Linux') + - uses: Swatinem/rust-cache@v1 + - name: Build uses: actions-rs/cargo@v1 with: command: build args: --verbose + - name: Test uses: actions-rs/cargo@v1 with: command: test args: --verbose + - name: Test (IPv6) uses: actions-rs/cargo@v1 with: @@ -48,15 +57,19 @@ jobs: args: --features v6-test --verbose fmt: - runs-on: ubuntu-latest + runs-on: [self-hosted,"${{ matrix.os }}"] steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + + - name: get channel + run: | + echo "channel=$(cat rust-toolchain.toml | grep channel | awk '{print $3}' | sed 's/"//g')" >> "$GITHUB_ENV" + + - name: set cargo env + uses: dtolnay/rust-toolchain@master with: - profile: minimal - toolchain: nightly - override: true - components: rustfmt + toolchain: ${{ env.channel }} + - name: Rustfmt uses: actions-rs/cargo@v1 with: @@ -64,15 +77,14 @@ jobs: args: --all -- --check clippy: - runs-on: ubuntu-latest + runs-on: [self-hosted,"${{ matrix.os }}"] steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - components: clippy + - uses: actions/checkout@v4 + + - name: get channel + run: | + echo "channel=$(cat rust-toolchain.toml | grep channel | awk '{print $3}' | sed 's/"//g')" >> "$GITHUB_ENV" + - name: Clippy uses: actions-rs/cargo@v1 with: