Skip to content

Commit

Permalink
Merge branch 'main' into fix-jest-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bartosz-lipinski authored Jul 26, 2021
2 parents cecbf58 + 3fc3f4d commit 105a608
Show file tree
Hide file tree
Showing 8 changed files with 3,136 additions and 571 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

- package-ecosystem: "cargo"
directory: "/program"
schedule:
interval: "daily"
23 changes: 23 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Frontend

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- uses: actions/setup-node@v2
with:
node-version: "14"
- run: yarn install
- name: Build
run: yarn build
85 changes: 85 additions & 0 deletions .github/workflows/program.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

env:
CARGO_TERM_COLOR: always
SOLANA_VERSION: "1.6.12"
RUST_TOOLCHAIN: stable

defaults:
run:
working-directory: ./program

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install Rust nightly
uses: actions-rs/toolchain@v1
with:
override: true
profile: minimal
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: rustfmt, clippy
- name: Cache dependencies
uses: Swatinem/rust-cache@v1
- name: Run fmt
run: cargo fmt -- --check
- name: Run clippy
run: cargo clippy -- --deny=warnings

unit-tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install Linux dependencies
run: sudo apt-get install -y pkg-config build-essential libudev-dev
- name: Install Rust nightly
uses: actions-rs/toolchain@v1
with:
override: true
profile: minimal
toolchain: ${{ env.RUST_TOOLCHAIN }}
- name: Cache dependencies
uses: Swatinem/rust-cache@v1
- name: Run unit tests
run: cargo test --lib

integration-tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Cache dependencies
uses: Swatinem/rust-cache@v1
- name: Install Linux dependencies
run: sudo apt-get install -y pkg-config build-essential libudev-dev

# Install Solana
- name: Cache Solana binaries
uses: actions/cache@v2
with:
path: ~/.cache/solana
key: ${{ runner.os }}-${{ env.SOLANA_VERSION }}
- name: Install Solana
run: |
sh -c "$(curl -sSfL https://release.solana.com/v${{ env.SOLANA_VERSION }}/install)"
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
solana --version
echo "Generating keypair..."
solana-keygen new -o "$HOME/.config/solana/id.json" --no-passphrase --silent
# Run tests
- name: Build program
run: cargo build-bpf
- name: Run tests
run: cargo test-bpf
3 changes: 1 addition & 2 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

image:
file: .gitpod.Dockerfile
tasks:
- init: |
sh -c "$(curl -sSfL https://release.solana.com/v1.6.9/install)"
sh -c "$(curl -sSfL https://release.solana.com/v1.6.12/install)"
export PATH=~/.local/share/solana/install/active_release/bin:$PATH
command: |
rustup toolchain link bpf node_modules/@solana/web3.js/bpf-sdk/dependencies/rust-bpf
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"@ledgerhq/hw-transport-webusb": "^5.41.0",
"@project-serum/serum": "^0.13.34",
"@project-serum/sol-wallet-adapter": "^0.2.4",
"@solana/spl-token": "0.1.3",
"@solana/spl-token-registry": "^0.2.64",
"@solana/spl-token-swap": "0.1.0",
"@solana/web3.js": "^1.7.1",
"@solana/spl-token": "^0.1.6",
"@solana/spl-token-registry": "^0.2.203",
"@solana/spl-token-swap": "^0.1.0",
"@solana/web3.js": "^1.22.0",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@types/react-router-dom": "^5.1.6",
Expand Down
Loading

0 comments on commit 105a608

Please sign in to comment.