From e10d4b4dd217ff32ccda1d137fce64c29cae4ae6 Mon Sep 17 00:00:00 2001 From: OlivierHecart Date: Tue, 19 Dec 2023 11:49:10 +0100 Subject: [PATCH] Fix workflow (#18) * Use checkout@v4 * Don't use cargo@v1 * Don't use toolchain@v1 --- .github/workflows/ci.yml | 11 +++--- .github/workflows/documentation.yml | 2 +- .github/workflows/publish_android.yml | 11 +++--- .github/workflows/publish_jvm.yml | 50 +++++++++++++++------------ .github/workflows/release.yml | 11 +++--- 5 files changed, 44 insertions(+), 41 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af0b399c..543e5204 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: os: [ ubuntu-latest, macOS-latest ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: @@ -39,11 +39,10 @@ jobs: add-to-path: false link-to-sdk: true - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - override: true - components: rustfmt, clippy + - name: Install Rust toolchain + run: | + rustup show + rustup component add rustfmt clippy - name: Cargo Format working-directory: zenoh-jni diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index b52f0bb4..15357151 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -13,7 +13,7 @@ jobs: name: Build and Deploy Documentation runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: nttld/setup-ndk@v1 id: setup-ndk diff --git a/.github/workflows/publish_android.yml b/.github/workflows/publish_android.yml index 73cce11d..6b015864 100644 --- a/.github/workflows/publish_android.yml +++ b/.github/workflows/publish_android.yml @@ -16,7 +16,7 @@ jobs: contents: read packages: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: @@ -30,11 +30,10 @@ jobs: add-to-path: false link-to-sdk: true - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - override: true - components: rustfmt, clippy + - name: Install Rust toolchain + run: | + rustup show + rustup component add rustfmt clippy - name: Setup Rust toolchains run: | diff --git a/.github/workflows/publish_jvm.yml b/.github/workflows/publish_jvm.yml index c8b7bcfd..03093a8c 100644 --- a/.github/workflows/publish_jvm.yml +++ b/.github/workflows/publish_jvm.yml @@ -19,28 +19,36 @@ jobs: matrix: job: # In order to load any added target at runtime, editing the Zenoh class under jvmMain is required. - - { target: x86_64-unknown-linux-gnu, + - { + target: x86_64-unknown-linux-gnu, arch: amd64, - os: ubuntu-20.04 - } + os: ubuntu-20.04, + build-cmd: "cargo", + } + - { + target: aarch64-unknown-linux-gnu, + arch: arm64, + os: ubuntu-20.04, + build-cmd: "cross", + } - { - target: aarch64-unknown-linux-gnu, - arch: arm64, - os: ubuntu-20.04, - use-cross: true, - } - - { target: x86_64-apple-darwin, + target: x86_64-apple-darwin, arch: darwin, - os: macos-latest - } - - { target: aarch64-apple-darwin, + os: macos-latest, + build-cmd: "cargo", + } + - { + target: aarch64-apple-darwin, arch: darwin, - os: macos-latest - } - - { target: x86_64-pc-windows-msvc, + os: macos-latest, + build-cmd: "cargo", + } + - { + target: x86_64-pc-windows-msvc, arch: win64, - os: windows-2019 - } + os: windows-2019, + build-cmd: "cargo", + } steps: - name: Checkout source code uses: actions/checkout@v4 @@ -59,17 +67,15 @@ jobs: ;; esac + cargo install cross --git https://github.com/cross-rs/cross + - name: Install Rust toolchain run: | rustup show rustup target add ${{ matrix.job.target }} - name: Build - uses: actions-rs/cargo@v1 - with: - use-cross: ${{ matrix.job.use-cross }} - command: build - args: --release --bins --lib --features=${{ github.event.inputs.features}} --target=${{ matrix.job.target }} --manifest-path zenoh-jni/Cargo.toml + run: ${{ matrix.job.build-cmd }} build --release --bins --lib --features=${{ github.event.inputs.features}} --target=${{ matrix.job.target }} --manifest-path zenoh-jni/Cargo.toml - name: Packaging id: package diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b3ebf691..97e46953 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: os: [ ubuntu-latest, macOS-latest ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: @@ -34,11 +34,10 @@ jobs: add-to-path: false link-to-sdk: true - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - override: true - components: rustfmt, clippy + - name: Install Rust toolchain + run: | + rustup show + rustup component add rustfmt clippy - name: Cargo Format working-directory: zenoh-jni