Skip to content

Commit

Permalink
fix: protoc not found in check step
Browse files Browse the repository at this point in the history
  • Loading branch information
Xu-Mj committed Jul 28, 2024
1 parent 4efe098 commit a86e09a
Showing 1 changed file with 29 additions and 22 deletions.
51 changes: 29 additions & 22 deletions .github/workflows/rust_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,9 @@ jobs:
cd /opt/protoc
wget https://github.com/protocolbuffers/protobuf/releases/download/v23.4/protoc-23.4-linux-x86_64.zip
unzip protoc-23.4-linux-x86_64.zip -d /opt/protoc
echo "/opt/protoc/bin" >> $GITHUB_PATH
- name: Cache | Dependencies
uses: actions/cache@v3
with:
path: /usr/local/include/librdkafka
key: librdkafka-dev-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: librdkafka-dev-${{ runner.os }}-

- name: Install | Dependencies
if: steps.cache_dependencies.outputs.cache-hit != 'true'
run: |
sudo apt update
sudo apt install -y librdkafka-dev
- name: Add Protoc to PATH
run: echo "/opt/protoc/bin" >> $GITHUB_PATH

- name: Setup | Install rustup
run: |
Expand Down Expand Up @@ -84,11 +73,6 @@ jobs:
- name: Setup | Checkout
uses: actions/checkout@v4

- name: Setup | Install rustup
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
- name: Setup | Cache Cargo
uses: actions/cache@v4
with:
Expand All @@ -99,6 +83,33 @@ jobs:
target/
key: ${{ runner.os }}-check-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}

- name: Cache | Protoc
id: cache_protoc_check
uses: actions/cache@v3
with:
path: /opt/protoc
key: protoc-${{ runner.os }}-23.x
restore-keys: protoc-${{ runner.os }}-

- name: Install | Protoc
if: steps.cache_protoc_check.outputs.cache-hit != 'true'
run: |
mkdir -p /opt/protoc
cd /opt/protoc
wget https://github.com/protocolbuffers/protobuf/releases/download/v23.4/protoc-23.4-linux-x86_64.zip
unzip protoc-23.4-linux-x86_64.zip -d /opt/protoc
- name: Add Protoc to PATH
run: echo "/opt/protoc/bin" >> $GITHUB_PATH

- name: Set PROTOC environment variable
run: echo "PROTOC=/opt/protoc/bin/protoc" >> $GITHUB_ENV

- name: Setup | Install rustup
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
- name: Setup | Disable rustup self-update
run: |
rustup set auto-self-update disable
Expand All @@ -118,7 +129,3 @@ jobs:
- name: Setup | check-all-features
run: |
cargo binstall -y cargo-all-features
- name: Build | Check all features
run: |
cargo check-all-features

0 comments on commit a86e09a

Please sign in to comment.