Skip to content

Commit

Permalink
workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
fanatid committed Oct 6, 2023
1 parent b33ed89 commit bb6f8a8
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 89 deletions.
49 changes: 39 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,52 @@
on:
push:
tags:
- 'v*'
pull_request:
paths:
- '.github/workflows/release.yml'

env:
CARGO_TERM_COLOR: always

jobs:
release:
runs-on: ubuntu-20.04
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
runs-on: ["${{ matrix.os }}"]
steps:
- uses: actions/checkout@v2

- name: Set env vars
run: |
source ci/rust-version.sh
rust_stable=$(rustc --version | awk '{print $2}')
echo "RUST_STABLE=$rust_stable" | tee -a $GITHUB_ENV
- if: runner.os == 'Linux'
- name: instal dependencies for 20.04
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libudev-dev libssl-dev libsasl2-dev libzstd-dev
sudo apt-get install -y \
gnupg \
libudev-dev \
libsasl2-dev \
libssl-dev \
libzstd-dev
- name: install protobuff 3.12
if: matrix.os == 'ubuntu-20.04'
run: |
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.8/protoc-3.15.8-linux-x86_64.zip
unzip protoc-3.15.8-linux-x86_64.zip -d $HOME/.local
export PATH="$PATH:$HOME/.local/bin"
- name: Install dependencies for 22.04
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y \
gnupg \
libudev-dev \
libsasl2-dev \
libssl-dev \
libzstd-dev \
protobuf-compiler
- uses: actions-rs/toolchain@v1
with:
Expand All @@ -44,6 +67,12 @@ jobs:
- name: Build release tarball
run: ./ci/create-tarball.sh

- name: Rename binaries for ubuntu22 release
if: matrix.os == 'ubuntu-22.04'
run: |
mv solana-accountsdb-plugin-kafka-release-x86_64-unknown-linux-gnu.tar.bz2 solana-accountsdb-plugin-kafka-release22-x86_64-unknown-linux-gnu.tar.bz2
mv solana-accountsdb-plugin-kafka-release-x86_64-unknown-linux-gnu.yml solana-accountsdb-plugin-kafka-release22-x86_64-unknown-linux-gnu.yml
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
Expand All @@ -53,4 +82,4 @@ jobs:
solana ${{ env.SOLANA_VERSION }}
rust ${{ env.RUST_STABLE }}
files: |
solana-accountsdb-plugin-kafka-release-*
solana-accountsdb-plugin-kafka-release*
41 changes: 34 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,53 @@

on:
push:
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
runs-on: ["${{ matrix.os }}"]
steps:
- uses: actions/checkout@v2

- name: Set env vars
run: |
source ci/rust-version.sh
rust_stable=$(rustc --version | awk '{print $2}')
echo "RUST_STABLE=$rust_stable" | tee -a $GITHUB_ENV
- if: runner.os == 'Linux'
- name: instal dependencies for 20.04
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libudev-dev libssl-dev libsasl2-dev libzstd-dev
sudo apt-get install -y \
gnupg \
libudev-dev \
libsasl2-dev \
libssl-dev \
libzstd-dev
- name: install protobuff 3.12
if: matrix.os == 'ubuntu-20.04'
run: |
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.8/protoc-3.15.8-linux-x86_64.zip
unzip protoc-3.15.8-linux-x86_64.zip -d $HOME/.local
export PATH="$PATH:$HOME/.local/bin"
- name: Install dependencies for 22.04
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y \
gnupg \
libudev-dev \
libsasl2-dev \
libssl-dev \
libzstd-dev \
protobuf-compiler
- uses: actions-rs/toolchain@v1
with:
Expand All @@ -31,12 +58,12 @@ jobs:
profile: minimal
components: rustfmt, clippy

- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUST_STABLE}}
key: ${{ matrix.os }}-cargo-build-${{ hashFiles('**/Cargo.lock', 'rust-toolchain.toml') }}-${{ env.RUST_STABLE }}

- name: cargo fmt
uses: actions-rs/cargo@v1
Expand Down
3 changes: 1 addition & 2 deletions ci/cargo-build-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
set -e
cd "$(dirname "$0")/.."

source ./ci/rust-version.sh stable

export RUSTFLAGS="-D warnings"
export RUSTBACKTRACE=1

set -x

# Build/test all host crates
rust_stable=$(rustc --version | awk '{print $2}')
cargo +"$rust_stable" build
cargo +"$rust_stable" test -- --nocapture

Expand Down
1 change: 0 additions & 1 deletion ci/create-tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ echo --- Creating release tarball
# Make CHANNEL available to include in the software version information
export CHANNEL

source ci/rust-version.sh stable
ci/cargo-install-all.sh stable "${RELEASE_BASENAME}"

tar cvf "${TARBALL_BASENAME}"-$TARGET.tar "${RELEASE_BASENAME}"
Expand Down
69 changes: 0 additions & 69 deletions ci/rust-version.sh

This file was deleted.

0 comments on commit bb6f8a8

Please sign in to comment.