🚀 add github-action
pipeline
#3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust CI - Test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
Test: | |
runs-on: soon-runtime-spot | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
contents: read # This is required for actions/checkout | |
if: always() && ((github.event_name == 'pull_request' && (github.base_ref == 'main' || github.base_ref == 'dev')) || (github.event_name == 'push' && (format('refs/heads/{0}', 'main') == github.ref || format('refs/heads/{0}', 'dev') == github.ref))) | |
steps: | |
- name: Check Env | |
run: | | |
printenv | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Check | |
run: | | |
ls | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Install Packages | |
uses: ConorMacBride/install-package@v1 | |
with: | |
apt: >- | |
pkg-config | |
build-essential | |
libssl-dev | |
clang | |
libclang-dev | |
- name: Download the file | |
uses: suisei-cn/actions-download-file@818d6b7dc8fe73f2f924b6241f2b1134ca1377d9 # 1.6.0 | |
with: | |
url: "https://github.com/solana-labs/solana/releases/download/v1.18.18/solana-release-x86_64-unknown-linux-gnu.tar.bz2" | |
target: ./ | |
auto-match: true | |
retry-times: 3 | |
- name: Extract solana-release-x86_64-unknown-linux-gnu.tar.bz2 | |
uses: ihiroky/extract-action@v1 | |
with: | |
file_path: solana-release-x86_64-unknown-linux-gnu.tar.bz2 | |
extract_dir: ./ | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
with: | |
repo-token: ${{ secrets.SOON_GITHUB_TOKEN }} | |
- name: Cache cargo registry | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-registry- | |
- name: Cache cargo build | |
uses: actions/cache@v2 | |
with: | |
path: target | |
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-build- | |
- name: Run tests | |
run: |- | |
export PATH="./solana-release/bin:$PATH" | |
which solana-keygen | |
make test | |
working-directory: "./" |