Skip to content

Commit

Permalink
add mvp from the private repo
Browse files Browse the repository at this point in the history
  • Loading branch information
glihm committed Oct 25, 2023
1 parent a05519c commit 97a14e4
Show file tree
Hide file tree
Showing 17 changed files with 3,666 additions and 670 deletions.
1 change: 1 addition & 0 deletions .env_example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export KATANA_CI_USERS_FILE=./users
83 changes: 83 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: ci

on:
push:
branches:
- main
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
setup:
runs-on: ubuntu-latest
outputs:
date: ${{ steps.date.outputs.date }}
steps:
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"

check:
needs: setup
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Cache cargo dependencies
uses: Swatinem/rust-cache@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check

test:
needs: check
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Cache cargo dependencies
uses: Swatinem/rust-cache@v2
- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace

lints:
if: github.event_name == 'pull_request'
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Cache cargo dependencies
uses: Swatinem/rust-cache@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
41 changes: 41 additions & 0 deletions .github/workflows/example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Example of katana-ci-action usage

on:
push:
branches:
- main

jobs:
katana-ci-example:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Startup Katana CI instance
id: katanaci
uses: ArkProjectNFTs/katana-ci-action@v1
with:
api-url: ${{ secrets.KATANA_CI_URL }}
api-key: ${{ secrets.KATANA_CI_KEY }}
cmd: 'start'

- name: Cache cargo dependencies
uses: Swatinem/rust-cache@v2

- name: Run cargo test
uses: actions-rs/cargo@v1
env:
STARKNET_RPC: ${{ steps.katanaci.outputs.katana-rpc }}
with:
command: run
args: --example e2e

- name: Terminate Katana CI instance
uses: ArkProjectNFTs/katana-ci-action@v1
with:
api-url: ${{ secrets.KATANA_CI_URL }}
api-key: ${{ secrets.KATANA_CI_KEY }}
cmd: 'stop'
name: ${{ steps.katanaci.outputs.katana-name }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/target
.env
.users
data.db
Loading

0 comments on commit 97a14e4

Please sign in to comment.