Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix workflow #173

Merged
merged 5 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 53 additions & 46 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,15 @@ jobs:
name: Code checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Rust toolchain
run: |
rustup show
rustup component add rustfmt clippy
- name: Code format check
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
run: cargo fmt --check
- name: Clippy check
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
run: cargo clippy -- -D warnings
- name: Environment setup
id: env
shell: bash
Expand Down Expand Up @@ -90,53 +84,78 @@ jobs:
fail-fast: false
matrix:
job:
- { target: x86_64-unknown-linux-gnu, arch: amd64, os: ubuntu-20.04 }
- { target: x86_64-apple-darwin, arch: darwin, os: macos-latest }
- { target: aarch64-apple-darwin, arch: darwin, os: macos-latest }
- {
target: x86_64-unknown-linux-gnu,
arch: amd64,
os: ubuntu-20.04,
build-cmd: "cargo",
}
- {
target: x86_64-apple-darwin,
arch: darwin,
os: macos-latest,
build-cmd: "cargo",
}
- {
target: aarch64-apple-darwin,
arch: darwin,
os: macos-latest,
build-cmd: "cargo",
}
- {
target: x86_64-unknown-linux-musl,
arch: amd64,
os: ubuntu-20.04,
use-cross: true,
build-cmd: "cross",
}
- {
target: arm-unknown-linux-gnueabi,
arch: armel,
os: ubuntu-20.04,
use-cross: true,
build-cmd: "cross",
}
- {
target: arm-unknown-linux-gnueabihf,
arch: armhf,
os: ubuntu-20.04,
use-cross: true,
build-cmd: "cross",
}
- {
target: armv7-unknown-linux-gnueabihf,
arch: armhf,
os: ubuntu-20.04,
use-cross: true,
build-cmd: "cross",
}
- {
target: aarch64-unknown-linux-gnu,
arch: arm64,
os: ubuntu-20.04,
use-cross: true,
build-cmd: "cross",
}
- {
target: aarch64-unknown-linux-musl,
arch: arm64,
os: ubuntu-20.04,
use-cross: true,
build-cmd: "cross",
}
- {
target: x86_64-pc-windows-msvc,
arch: win64,
os: windows-2019,
build-cmd: "cargo",
}
- { target: x86_64-pc-windows-msvc, arch: win64, os: windows-2019 }
##
## NOTE: cannon build for Windows GNU as not supported by cyclors
##
# - { target: x86_64-pc-windows-gnu, arch: win64 , os: windows-2019 }
# - {
# target: x86_64-pc-windows-gnu,
# arch: win64,
# os: windows-2019,
# build-cmd: "cargo",
# }
steps:
- name: Checkout source code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 500 # NOTE: get long history for git-version crate to correctly compute a version
- name: Fetch Git tags # NOTE: workaround for https://github.com/actions/checkout/issues/290
Expand Down Expand Up @@ -164,38 +183,26 @@ 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: zenoh-plugin-dds > Build
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.job.use-cross }}
command: build
args: --release --target=${{ matrix.job.target }} -p zenoh-plugin-dds

run: ${{ matrix.job.build-cmd }} build --release --target=${{ matrix.job.target }} -p zenoh-plugin-dds

- name: zenoh-bridge-dds > Build
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.job.use-cross }}
command: build
args: --release --target=${{ matrix.job.target }} -p zenoh-bridge-dds
run: ${{ matrix.job.build-cmd }} build --release --target=${{ matrix.job.target }} -p zenoh-bridge-dds

- name: zenoh-plugin-dds > Debian package
if: contains(matrix.job.target, '-linux-gnu')
uses: actions-rs/cargo@v1
with:
command: deb
args: --no-build --target=${{ matrix.job.target }} -p zenoh-plugin-dds
run: cargo deb --no-build --target=${{ matrix.job.target }} -p zenoh-plugin-dds

- name: zenoh-bridge-dds > Debian package
if: contains(matrix.job.target, '-linux-gnu')
uses: actions-rs/cargo@v1
with:
command: deb
args: --no-build --target=${{ matrix.job.target }} -p zenoh-bridge-dds
run: cargo deb --no-build --target=${{ matrix.job.target }} -p zenoh-bridge-dds

- name: Packaging
id: package
Expand Down Expand Up @@ -262,7 +269,7 @@ jobs:
needs: [checks, builds]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 500 # NOTE: get long history for git-version crate to correctly compute a version
- name: Fetch Git tags # NOTE: workaround for https://github.com/actions/checkout/issues/290
Expand All @@ -281,19 +288,19 @@ jobs:
unzip PACKAGES/aarch64-unknown-linux-musl/zenoh-bridge-dds-${{ needs.checks.outputs.PKG_VERSION }}-aarch64-unknown-linux-musl.zip -d docker/linux/arm64/
tree docker
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: Docker meta - set tags and labels
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v5
with:
images: eclipse/zenoh-bridge-dds
- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_COM_USERNAME }}
password: ${{ secrets.DOCKER_COM_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
Expand Down Expand Up @@ -339,7 +346,7 @@ jobs:
scp -o "StrictHostKeyChecking=no" -r * ${SSH_TARGET}:${DOWNLOAD_DIR}/
echo "---- cleanup identity"
ssh-add -D
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Rust toolchain
run: rustup show
- name: Publish to crates.io
Expand Down
37 changes: 8 additions & 29 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install ACL
if: startsWith(matrix.os,'ubuntu')
Expand All @@ -44,43 +44,22 @@ jobs:
rustup component add rustfmt clippy

- name: Code format check
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
run: cargo fmt --check

- name: Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all --examples -- -D warnings
run: cargo clippy --all --examples -- -D warnings

- name: Build zenoh-plugin-dds
uses: actions-rs/cargo@v1
with:
command: build
args: -p zenoh-plugin-dds --verbose --all-targets
run: cargo build -p zenoh-plugin-dds --verbose --all-targets

- name: Build zenoh-plugin-dds (with dds_shm)
uses: actions-rs/cargo@v1
with:
command: build
args: -p zenoh-plugin-dds --features dds_shm --verbose --all-targets
run: cargo build -p zenoh-plugin-dds --features dds_shm --verbose --all-targets

- name: Build zenoh-bridge-dds
uses: actions-rs/cargo@v1
with:
command: build
args: -p zenoh-bridge-dds --verbose --all-targets
run: cargo build -p zenoh-bridge-dds --verbose --all-targets

- name: Build zenoh-bridge-dds (with dds_shm)
uses: actions-rs/cargo@v1
with:
command: build
args: -p zenoh-bridge-dds --features dds_shm --verbose --all-targets
run: cargo build -p zenoh-bridge-dds --features dds_shm --verbose --all-targets

- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose
run: cargo test --verbose