-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #193 from silas-x/master
CI: Update Rust workflow and add TS workflow
- Loading branch information
Showing
4 changed files
with
123 additions
and
24 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,13 +6,23 @@ on: | |
'programs/**', | ||
'lib/client/**', | ||
'Cargo.lock', | ||
'.github/workflows/ci-code-review-rust.yml', | ||
] | ||
workflow_dispatch: # Pick branch manually | ||
|
||
pull_request: | ||
branches: ['master'] | ||
paths: | ||
[ | ||
'programs/**', | ||
'lib/client/**', | ||
'Cargo.lock', | ||
] | ||
|
||
workflow_dispatch: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
SOLANA_VERSION: '1.16.1' | ||
RUST_TOOLCHAIN: '1.70.0' | ||
|
||
jobs: | ||
format: | ||
|
@@ -21,20 +31,31 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
components: rustfmt | ||
override: true | ||
run: rustup toolchain install ${{ env.RUST_TOOLCHAIN }} --component rustfmt | ||
|
||
- name: Run fmt | ||
run: cargo fmt -- --check | ||
|
||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Cache dependencies | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Install Rust toolchain | ||
run: rustup toolchain install ${{ env.RUST_TOOLCHAIN }} --component clippy | ||
|
||
- name: Run Clippy | ||
run: cargo clippy --features enable-gpl -- --no-deps -D warnings --allow=clippy::result-large-err | ||
|
||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
|
@@ -48,18 +69,10 @@ jobs: | |
uses: extractions/setup-just@v1 | ||
|
||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: 1.70.0 | ||
profile: minimal | ||
components: rustc | ||
override: true | ||
default: true | ||
run: rustup toolchain install ${{ env.RUST_TOOLCHAIN }} | ||
|
||
- name: Cache dependencies | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
env-vars: 'SOLANA_VERSION' | ||
|
||
- name: Install Solana | ||
uses: metadaoproject/[email protected] | ||
|
@@ -73,3 +86,10 @@ jobs: | |
- name: Run tests all deps | ||
run: just test-all | ||
shell: bash | ||
|
||
all-pass: | ||
name: All tests pass 📖 | ||
needs: ['format', 'lint', 'test'] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: echo ok |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Code Review - TS | ||
|
||
on: | ||
push: | ||
paths: | ||
[ | ||
'ts/**', | ||
'yarn.lock' | ||
] | ||
pull_request: | ||
branches: ['master'] | ||
paths: | ||
[ | ||
'ts/**', | ||
'yarn.lock' | ||
] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
format: | ||
name: Format | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
cache: 'yarn' | ||
|
||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Format | ||
run: yarn format | ||
|
||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
cache: 'yarn' | ||
|
||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Lint | ||
run: yarn lint | ||
|
||
sast: | ||
name: Static security scan | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Initialise CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: 'javascript' | ||
|
||
- name: Run CodeQL | ||
uses: github/codeql-action/analyze@v2 | ||
|
||
all-pass: | ||
name: All tests pass 📖 | ||
needs: ['format', 'lint', 'sast'] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: echo ok |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
cargo-features = ["workspace-inheritance"] | ||
|
||
[package] | ||
edition = "2021" | ||
name = "openbook-v2-client" | ||
|
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