Use shell script to install protobuf
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
parent
9388ecf699
commit
ece06a08be
|
|
@ -17,9 +17,7 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: arduino/setup-protoc@v2
|
- run: ./scripts/install-protobuf.sh
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- run: cargo check --examples --tests -p containerd-shim -p containerd-shim-protos
|
- run: cargo check --examples --tests -p containerd-shim -p containerd-shim-protos
|
||||||
|
|
||||||
- run: rustup toolchain install nightly --component rustfmt
|
- run: rustup toolchain install nightly --component rustfmt
|
||||||
|
|
@ -41,9 +39,7 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: arduino/setup-protoc@v2
|
- run: ./scripts/install-protobuf.sh
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Tests
|
- name: Tests
|
||||||
run: |
|
run: |
|
||||||
cargo test -p containerd-shim -p containerd-shim-protos
|
cargo test -p containerd-shim -p containerd-shim-protos
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,9 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: arduino/setup-protoc@v2
|
|
||||||
with:
|
- run: ./scripts/install-protobuf.sh
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- run: cargo check --examples --tests --all-targets
|
- run: cargo check --examples --tests --all-targets
|
||||||
- run: cargo check --examples --tests --all-targets --all-features
|
- run: cargo check --examples --tests --all-targets --all-features
|
||||||
|
|
||||||
|
|
@ -45,16 +45,13 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: arduino/setup-protoc@v2
|
- run: ./scripts/install-protobuf.sh
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- env:
|
- env:
|
||||||
# runc::tests::test_exec needs $XDG_RUNTIME_DIR to be set
|
# runc::tests::test_exec needs $XDG_RUNTIME_DIR to be set
|
||||||
XDG_RUNTIME_DIR: /tmp/dummy-xdr
|
XDG_RUNTIME_DIR: /tmp/dummy-xdr
|
||||||
run: |
|
run: |
|
||||||
# runc-shim::cgroup::test_add_cgroup needs root permission to set cgroup
|
# runc-shim::cgroup::test_add_cgroup needs root permission to set cgroup
|
||||||
mkdir -p /tmp/dummy-xdr
|
mkdir -p /tmp/dummy-xdr
|
||||||
export PROTOC=$(which protoc)
|
|
||||||
sudo -E $(command -v cargo) test
|
sudo -E $(command -v cargo) test
|
||||||
sudo -E $(command -v cargo) test --all-features
|
sudo -E $(command -v cargo) test --all-features
|
||||||
|
|
||||||
|
|
@ -67,9 +64,7 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: arduino/setup-protoc@v2
|
- run: ./scripts/install-protobuf.sh
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- run: cargo build --all-features --timings
|
- run: cargo build --all-features --timings
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Helper script for Github Actions to install protobuf on different runners.
|
||||||
|
|
||||||
|
if [ "$RUNNER_OS" == 'Linux' ]; then
|
||||||
|
# Install on Linux
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y protobuf-compiler
|
||||||
|
elif [ "$RUNNER_OS" == 'macOS' ]; then
|
||||||
|
# Install on macOS
|
||||||
|
brew install protobuf
|
||||||
|
elif [ "$RUNNER_OS" == 'Windows' ]; then
|
||||||
|
# Install on Windows
|
||||||
|
choco install protoc
|
||||||
|
else
|
||||||
|
echo "Unsupported OS: $RUNNER_OS"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check the installed Protobuf version
|
||||||
|
protoc --version
|
||||||
Loading…
Reference in New Issue