Skip to content

Commit

Permalink
initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
X committed Nov 25, 2023
0 parents commit b511927
Show file tree
Hide file tree
Showing 39 changed files with 11,915 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Various IDEs and Editors
.vscode/
.idea/
**/*~

# Mac OSX temporary files
.DS_Store
**/.DS_Store

# dfx temporary files
.dfx/

# rust
target/
release-artifacts/

# frontend code
node_modules/
dist/
public

# e2e tests
test-results/
playwright-report/
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{yml,yaml}]
indent_size = 2
44 changes: 44 additions & 0 deletions .github/actions/setup-dfx/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "Setup DFX"
description: Setup DFX

runs:
using: "composite"
steps:
- name: Get DFX version
shell: bash
run: echo "dfx_version=$(cat dfx.json | jq -r .dfx)" >> "$GITHUB_ENV"

- name: Cache DFX
uses: actions/cache@v3
with:
path: /usr/local/bin/dfx
key: dfx-cache-${{ env.dfx_version }}

- name: Install DFX
shell: bash
run: |
if command -v dfx
then
echo "DFX restored from cache"
else
echo "DFX not restored from cache, running install script:"
DFX_VERSION=${{ env.dfx_version }} sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"
fi
echo "DFX version"
dfx --version
- name: Configure DFX
shell: bash
run: |
mkdir -p $HOME/.config/dfx
cat <<EOF >$HOME/.config/dfx/networks.json
{
"local": {
"bind": "127.0.0.1:8080",
"type": "ephemeral",
"replica": {
"subnet_type": "system"
}
}
}
EOF
29 changes: 29 additions & 0 deletions .github/actions/setup-ic-wasm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Setup IC WASM"
description: Setup IC WASM

runs:
using: "composite"
steps:
- name: Get IC WASM version
shell: bash
run: echo "ic_wasm_version=$(cat .ic-wasm-version | xargs)" >> "$GITHUB_ENV"

- name: Cache IC WASM
uses: actions/cache@v3
with:
path: /usr/local/bin/ic-wasm
key: ic-wasm-cache-${{ env.ic_wasm_version }}

- name: Install IC WASM
shell: bash
run: |
if command -v ic-wasm
then
echo "IC WASM restored from cache"
else
echo "IC WASM not restored from cache, downloading:"
curl -L https://github.com/dfinity/ic-wasm/releases/download/${{ env.ic_wasm_version }}/ic-wasm-linux64 -o /usr/local/bin/ic-wasm
chmod +x /usr/local/bin/ic-wasm
fi
echo "IC WASM version"
ic-wasm --version
10 changes: 10 additions & 0 deletions .github/actions/setup-nodejs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: "Setup nodejs"
description: Setup nodejs

runs:
using: "composite"
steps:
- uses: actions/setup-node@v3
with:
node-version-file: ".node-version"
cache: "npm"
18 changes: 18 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Docker Image CI

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

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build the release binary image
run: make release
- name: Print the git commit and the binary hash
run: make hashes
37 changes: 37 additions & 0 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Lint and Test

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

jobs:
lint_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-nodejs
- uses: ./.github/actions/setup-ic-wasm

- name: Install NPM dependencies
run: npm ci

- name: Build frontend
run: NODE_ENV=production npm run build --quiet

- name: Build canister
run: |
./build.sh barebones
- name: Rust lint
run: cargo clippy --tests --benches -- -D clippy::all

- name: Rust test
run: cargo test

- name: Check Rust formatting
run: cargo fmt --all -- --check

- name: Check Frontend formatting
run: npm run format:check
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Various IDEs and Editors
.vscode/*
!.vscode/extensions.json
.idea/
**/*~

# Mac OSX temporary files
.DS_Store
**/.DS_Store

# dfx temporary files
.dfx/

# rust
target/
release-artifacts/

# frontend code
node_modules/
dist/

# e2e tests
test-results/
playwright-report/
1 change: 1 addition & 0 deletions .ic-wasm-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.5.1
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.9.0
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repos:
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0"
hooks:
- id: prettier
26 changes: 26 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Various IDEs and Editors
.vscode/*
!.vscode/extensions.json
.idea/
**/*~

# Mac OSX temporary files
.DS_Store
**/.DS_Store

# dfx temporary files
.dfx/

# rust
target/
release-artifacts/
src/backend/
src/bucket/

# frontend code
node_modules/
dist/

# e2e tests
test-results/
playwright-report/
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"rust-lang.rust-analyzer"
]
}
Loading

0 comments on commit b511927

Please sign in to comment.