Skip to content

Commit

Permalink
Prepare repository for open sourcing
Browse files Browse the repository at this point in the history
  • Loading branch information
dguenther committed Apr 5, 2021
0 parents commit 9eee8e2
Show file tree
Hide file tree
Showing 763 changed files with 73,770 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @iron-fish/code-review
184 changes: 184 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
name: Node.js CI

on: [push]

jobs:
lint:
name: Lint

runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.16.0'

- name: Use wasm-pack
uses: actions-rs/[email protected]
with:
crate: wasm-pack
version: latest
use-tool-cache: true

- name: Cache Cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Cache Cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: ${{ runner.os }}-stable-cargo-index-${{ hashFiles('**/Cargo.lock') }}

- name: Cache Cargo build
uses: actions/cache@v1
with:
path: ironfish-wasm/target
key: ${{ runner.os }}-stable-target-${{ hashFiles('**/Cargo.lock') }}

- name: Restore Yarn cache
id: yarn-cache
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- name: Build Wasm packages
run: cd ironfish-wasm && yarn build

- name: Install packages
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn --non-interactive --frozen-lockfile

- name: Lint
run: yarn lint

test:
name: Test

runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.16.0'

- name: Use wasm-pack
uses: actions-rs/[email protected]
with:
crate: wasm-pack
version: latest
use-tool-cache: true

- name: Cache Cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Cache Cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: ${{ runner.os }}-stable-cargo-index-${{ hashFiles('**/Cargo.lock') }}

- name: Cache Cargo build
uses: actions/cache@v1
with:
path: ironfish-wasm/target
key: ${{ runner.os }}-stable-target-${{ hashFiles('**/Cargo.lock') }}

- name: Restore Yarn cache
id: yarn-cache
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- name: Build Wasm packages
run: cd ironfish-wasm && yarn build

- name: Install packages
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn --non-interactive --frozen-lockfile

- name: Run tests
run: yarn test:coverage

- name: Upload coverage
run: CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} ROOT_PATH=$GITHUB_WORKSPACE/ yarn coverage:upload

testslow:
name: Slow Tests

runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.16.0'

- name: Use wasm-pack
uses: actions-rs/[email protected]
with:
crate: wasm-pack
version: latest
use-tool-cache: true

- name: Cache Cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Cache Cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: ${{ runner.os }}-stable-cargo-index-${{ hashFiles('**/Cargo.lock') }}

- name: Cache Cargo build
uses: actions/cache@v1
with:
path: ironfish-wasm/target
key: ${{ runner.os }}-stable-target-${{ hashFiles('**/Cargo.lock') }}

- name: Restore Yarn cache
id: yarn-cache
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- name: Build Wasm packages
run: cd ironfish-wasm && yarn build

- name: Install packages
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn --non-interactive --frozen-lockfile

- name: Run slow tests & coverage
run: yarn test:slow:coverage

- name: Upload coverage
run: CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} ROOT_PATH=$GITHUB_WORKSPACE/ yarn coverage:upload
36 changes: 36 additions & 0 deletions .github/workflows/deploy-api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Deploy API Image
on: workflow_dispatch

jobs:
Deploy:
name: Deploy
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.16.0'

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2

- name: Login to AWS Registry
run: aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $AWS_BLOCK_API_REGISTRY_URL
env:
AWS_BLOCK_API_REGISTRY_URL: ${{ secrets.AWS_BLOCK_API_REGISTRY_URL }}

- name: Build API Image
run: ./ironfish-http-api/scripts/build-docker.sh

- name: Deploy API Image
run: ./ironfish-http-api/scripts/deploy-docker.sh
env:
AWS_BLOCK_API_REGISTRY_URL: ${{ secrets.AWS_BLOCK_API_REGISTRY_URL }}
36 changes: 36 additions & 0 deletions .github/workflows/deploy-blockexplorer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Deploy Block Explorer Image
on: workflow_dispatch

jobs:
Deploy:
name: Deploy
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.16.0'

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2

- name: Login to AWS Registry
run: aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $AWS_BLOCK_EXPLORER_REGISTRY_URL
env:
AWS_BLOCK_EXPLORER_REGISTRY_URL: ${{ secrets.AWS_BLOCK_EXPLORER_REGISTRY_URL }}

- name: Build Rosetta Image
run: ./ironfish-rosetta-api/scripts/build-docker.sh

- name: Deploy Rosetta Image
run: ./ironfish-rosetta-api/scripts/deploy-docker.sh
env:
AWS_BLOCK_EXPLORER_REGISTRY_URL: ${{ secrets.AWS_BLOCK_EXPLORER_REGISTRY_URL }}
36 changes: 36 additions & 0 deletions .github/workflows/deploy-bootstrap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Deploy Bootstrap Image
on: workflow_dispatch

jobs:
Deploy:
name: Deploy
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.16.0'

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2

- name: Login to AWS Registry
run: aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $AWS_REGISTRY_URL
env:
AWS_REGISTRY_URL: ${{ secrets.AWS_REGISTRY_URL }}

- name: Build Bootstrap Image
run: ./ironfish-cli/scripts/build-docker.sh

- name: Deploy Bootstrap Image
run: ./ironfish-cli/scripts/deploy-docker.sh
env:
AWS_REGISTRY_URL: ${{ secrets.AWS_REGISTRY_URL }}
63 changes: 63 additions & 0 deletions .github/workflows/deploy-brew.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Deploy Brew Tap Release
on: workflow_dispatch

jobs:
Deploy:
name: Deploy
runs-on: macos-10.15

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: "Use Rust Toolchain"
uses: actions-rs/toolchain@v1
with:
components: rustfmt, clippy

- name: Use wasm-pack
uses: actions-rs/[email protected]
with:
crate: wasm-pack
version: latest
use-tool-cache: true

- name: Cache Cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Cache Cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: ${{ runner.os }}-stable-cargo-index-${{ hashFiles('**/Cargo.lock') }}

- name: Cache Cargo build
uses: actions/cache@v1
with:
path: ironfish-wasm/target
key: ${{ runner.os }}-stable-target-${{ hashFiles('**/Cargo.lock') }}

- name: Cache Ironfish CLI Build
id: cache-ironfish-cli-build
uses: actions/cache@v1
with:
path: ironfish-cli/build.cli/ironfish-cli.tar.gz
key: ${{ github.sha }}

- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.16.0'

- name: Build Ironfish CLI
if: steps.cache-ironfish-cli-build.outputs.cache-hit != 'true'
run: ./ironfish-cli/scripts/build.sh

- name: Deploy Ironfish CLI Brew
run: ./ironfish-cli/scripts/deploy-brew.sh
env:
BREW_GITHUB_USERNAME: ${{ secrets.BREW_GITHUB_USERNAME }}
BREW_GITHUB_TOKEN: ${{ secrets.BREW_GITHUB_TOKEN }}
Loading

0 comments on commit 9eee8e2

Please sign in to comment.