Skip to content

Commit

Permalink
Merge-Adds GitHub actions configuration
Browse files Browse the repository at this point in the history
Request-Adds GitHub actions configuration
  • Loading branch information
kazupot7 authored Aug 6, 2024
2 parents cca293f + ea64482 commit c13ed72
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 1 deletion.
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"
53 changes: 53 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Frontend

on:
push:
branches: [master]
pull_request:
branches: [master]

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

lint:
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: Lint
run: yarn lint

test:
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: Test
run: yarn test
79 changes: 79 additions & 0 deletions .github/workflows/program.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: CI

on:
push:
branches: [master]
pull_request:
branches: [master]

env:
CARGO_TERM_COLOR: always
SOLANA_VERSION: "1.6.11"
RUST_TOOLCHAIN: nightly-2021-06-09

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 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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"program:build": "cd program && cargo build-bpf",
"program:test": "cd program && cargo test-bpf",
"localnet:up": "solana-test-validator --bpf-program BpfProgram1111111111111111111111111111111111 program/target/deploy/bpf_program_template.so --reset",
"localnet:logs": "solana logs -u localhost",
"localnet:logs": "solana logs",
"predeploy": "git pull --ff-only && yarn && yarn build",
"deploy": "gh-pages -d build",
"deploy:ar": "arweave deploy-dir build --key-file ",
Expand Down

0 comments on commit c13ed72

Please sign in to comment.