Skip to content

Commit

Permalink
ci: update actions (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
fanatid authored Jun 8, 2024
1 parent 1d467b9 commit 485af5b
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 25 deletions.
35 changes: 29 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
permissions:
contents: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:
paths:
- '.github/workflows/release.yml'
push:
tags:
- 'v*'
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
Expand All @@ -11,7 +24,7 @@ jobs:
os: [ubuntu-20.04, ubuntu-22.04]
runs-on: ["${{ matrix.os }}"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set env vars
run: |
Expand Down Expand Up @@ -48,12 +61,22 @@ jobs:
libzstd-dev \
protobuf-compiler
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_STABLE }}
override: true
profile: minimal
components: rustfmt
components: clippy

- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
./target
key: cargo-${{ matrix.os }}-${{ hashFiles('rust-toolchain.toml') }}-${{ hashFiles('**/Cargo.lock') }}-0000
restore-keys: |
cargo-${{ matrix.os }}-${{ hashFiles('rust-toolchain.toml') }}
- name: Check Solana version
run: |
Expand All @@ -74,7 +97,7 @@ jobs:
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
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
body: |
Expand Down
47 changes: 28 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
# Source:
# https://github.com/solana-labs/solana-accountsdb-plugin-postgres/blob/master/.github/workflows/test.yml

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:
push:
branches:
- 'master'
- 'v1.17-triton'
- 'v1.16-triton'
- 'v1.14-triton'
- 'v1.10-triton'
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
Expand All @@ -14,7 +26,7 @@ jobs:
os: [ubuntu-20.04, ubuntu-22.04]
runs-on: ["${{ matrix.os }}"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set env vars
run: |
Expand Down Expand Up @@ -51,31 +63,28 @@ jobs:
libzstd-dev \
protobuf-compiler
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_STABLE }}
override: true
profile: minimal
components: rustfmt, clippy
components: clippy

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ matrix.os }}-cargo-build-${{ hashFiles('**/Cargo.lock', 'rust-toolchain.toml') }}-${{ env.RUST_STABLE }}
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
./target
key: cargo-${{ matrix.os }}-${{ hashFiles('rust-toolchain.toml') }}-${{ hashFiles('**/Cargo.lock') }}-0000
restore-keys: |
cargo-${{ matrix.os }}-${{ hashFiles('rust-toolchain.toml') }}
- name: cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Run fmt
run: cargo fmt --all -- --check

- name: cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace --all-targets -- --deny=warnings
- name: Run clippy
run: cargo clippy --all-targets --tests -- -Dwarnings

- name: Build
run: ./ci/cargo-build-test.sh

0 comments on commit 485af5b

Please sign in to comment.