Skip to content

Commit

Permalink
snake case for canister names; fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
happyhackerbird committed May 13, 2024
1 parent 230c57a commit d3d600d
Show file tree
Hide file tree
Showing 42 changed files with 95 additions and 92 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/ci-local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,16 @@ jobs:
run: |
dfx start --clean --background
dfx canister create --all
- name: Deploy Civic Canister
run: src/civic_canister_backend/deploy-civic.sh
- name: Set env variables
run: |
export VITE_LOCAL_CIVIC_FRONTEND_CANISTER_ID=$(dfx canister id civic-canister-frontend)
export VITE_LOCAL_CIVIC_FRONTEND_CANISTER_ID=$(dfx canister id civic_canister_frontend)
export VITE_LOCAL_INTERNET_IDENTITY_CANISTER_ID=$(dfx canister id internet_identity)
export VITE_LOCAL_CIVIC_BACKEND_CANISTER_ID=$(dfx canister id civic_canister_backend)
export VITE_LOCAL_RELYING_FRONTEND_CANISTER_ID=$(dfx canister id relying_canister_frontend)
- name: Deploy Canisters
run: |
dfx deploy internet_identity
dfx deploy civic-canister-frontend
dfx deploy
src/civic_canister_backend/deploy-civic.sh
- name: Run tests
run: |
chmod +x ic-test-state-machine
Expand Down
116 changes: 58 additions & 58 deletions .github/workflows/ci-main.yaml
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
name: CI Build and Test (Mainnet setup)
# name: CI Build and Test (Mainnet setup)

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

env:
CARGO_TERM_COLOR: always
# env:
# CARGO_TERM_COLOR: always

jobs:
# jobs:

build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
include:
- os: ubuntu-latest
file_suffix: "-linux"
- os: macos-latest
file_suffix: "-mac"
# build:
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [ubuntu-latest, macos-latest]
# include:
# - os: ubuntu-latest
# file_suffix: "-linux"
# - os: macos-latest
# file_suffix: "-mac"

steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up environment
run: |
echo "Setting up on ${{ matrix.os }}"
mv ic-test-machine-binaries/ic-test-state-machine${{ matrix.file_suffix }} ic-test-state-machine
# steps:
# - name: Check out repository code
# uses: actions/checkout@v4
# with:
# submodules: 'recursive'
# - name: Set up environment
# run: |
# echo "Setting up on ${{ matrix.os }}"
# mv ic-test-machine-binaries/ic-test-state-machine${{ matrix.file_suffix }} ic-test-state-machine

- name: Install dfx
uses: dfinity/setup-dfx@main
- name: Confirm successful installation
run: dfx --version
- name: Install Rust target
run: rustup target add wasm32-unknown-unknown
- name: Install dependencies
run: |
npm install
cargo install ic-wasm
- name: Create canisters and start local ICP replica
run: |
dfx start --clean --background
dfx canister create --all
- name: Deploy Civic Canister
run: src/civic_canister_backend/deploy-civic.sh --network ic
- name: Set env variables
run: |
# export VITE_LOCAL_CIVIC_FRONTEND_CANISTER_ID=$(dfx canister id civic-canister-frontend)
# export VITE_LOCAL_INTERNET_IDENTITY_CANISTER_ID=$(dfx canister id internet_identity)
# export VITE_LOCAL_CIVIC_BACKEND_CANISTER_ID=$(dfx canister id civic_canister_backend)
- name: Deploy Canisters
run: |
dfx deploy internet_identity
dfx deploy civic-canister-frontend
- name: Run tests
run: |
chmod +x ic-test-state-machine
cargo test --test integration_tests
- run: echo "🐧 This job's status is ${{ job.status }}."
# - name: Install dfx
# uses: dfinity/setup-dfx@main
# - name: Confirm successful installation
# run: dfx --version
# - name: Install Rust target
# run: rustup target add wasm32-unknown-unknown
# - name: Install dependencies
# run: |
# npm install
# cargo install ic-wasm
# - name: Create canisters and start local ICP replica
# run: |
# dfx start --clean --background
# dfx canister create --all
# - name: Deploy Civic Canister
# run: src/civic_canister_backend/deploy-civic.sh --network ic
# - name: Set env variables
# run: |
# # export VITE_LOCAL_CIVIC_FRONTEND_CANISTER_ID=$(dfx canister id civic_canister_frontend)
# # export VITE_LOCAL_INTERNET_IDENTITY_CANISTER_ID=$(dfx canister id internet_identity)
# # export VITE_LOCAL_CIVIC_BACKEND_CANISTER_ID=$(dfx canister id civic_canister_backend)
# - name: Deploy Canisters
# run: |
# dfx deploy internet_identity
# dfx deploy civic_canister_frontend
# - name: Run tests
# run: |
# chmod +x ic-test-state-machine
# cargo test --test integration_tests
# - run: echo "🐧 This job's status is ${{ job.status }}."
16 changes: 10 additions & 6 deletions dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,20 @@
"type": "rust"
},

"civic-canister-frontend": {
"source": ["src/civic-canister-frontend/dist"],
"civic_canister_frontend": {
"source": [
"src/civic_canister_frontend/dist"
],
"type": "assets",
"workspace": "civic-canister-frontend"
"workspace": "civic_canister_frontend"
},

"relying-canister-frontend": {
"source": ["src/relying-canister-frontend/dist"],
"relying_canister_frontend": {
"source": [
"src/relying_canister_frontend/dist"
],
"type": "assets",
"workspace": "relying-canister-frontend"
"workspace": "relying_canister_frontend"
}
},
"defaults": {
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"type": "module",
"workspaces": [
"src/civic-canister-frontend",
"src/relying-canister-frontend"
"src/civic_canister_frontend",
"src/relying_canister_frontend"
]
}
4 changes: 0 additions & 4 deletions src/civic-canister-frontend/.env.local

This file was deleted.

2 changes: 1 addition & 1 deletion src/civic_canister_backend/deploy-civic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ cd "$SCRIPTS_DIR/.."
DFX_NETWORK="${DFX_NETWORK:-local}"
II_CANISTER_ID="${II_CANISTER_ID:-$(dfx canister id internet_identity --network "$DFX_NETWORK")}"
ISSUER_CANISTER_ID="${ISSUER_CANISTER_ID:-$(dfx canister id civic_canister_backend --network "$DFX_NETWORK")}"
CIVIC_FRONTEND_CANISTER_ID="${CIVIC_FRONTEND_CANISTER_ID:-$(dfx canister id civic-canister-frontend --network "$DFX_NETWORK")}"
CIVIC_FRONTEND_CANISTER_ID="${CIVIC_FRONTEND_CANISTER_ID:-$(dfx canister id civic_canister_frontend --network "$DFX_NETWORK")}"
if [ "$DFX_NETWORK" = "local" ]; then
REPLICA_SERVER_PORT=$(dfx info webserver-port)
ISSUER_DERIVATION_ORIGIN="http://${ISSUER_CANISTER_ID}.localhost:${REPLICA_SERVER_PORT}"
Expand Down
4 changes: 4 additions & 0 deletions src/civic_canister_frontend/.env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
VITE_LOCAL_INTERNET_IDENTITY_CANISTER_ID=avqkn-guaaa-aaaaa-qaaea-cai
VITE_LOCAL_CIVIC_FRONTEND_CANISTER_ID=by6od-j4aaa-aaaaa-qaadq-cai
VITE_LOCAL_CIVIC_BACKEND_CANISTER_ID=b77ix-eeaaa-aaaaa-qaada-cai
VITE_LOCAL_HOST=localhost:4943
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"vite-plugin-environment": "^1.1.3",
"vitest": "^0.32.2"
},
"name": "civic-canister-frontend",
"name": "civic_canister_frontend",
"private": true,
"scripts": {
"build": "tsc && vite build",
Expand All @@ -34,4 +34,4 @@
},
"type": "module",
"version": "0.0.0"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 0 additions & 4 deletions src/relying-canister-frontend/.env.local

This file was deleted.

4 changes: 4 additions & 0 deletions src/relying_canister_frontend/.env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
VITE_LOCAL_HOST=localhost:4943
VITE_LOCAL_INTERNET_IDENTITY_CANISTER_ID=avqkn-guaaa-aaaaa-qaaea-cai
VITE_LOCAL_RELYING_FRONTEND_CANISTER_ID=asrmz-lmaaa-aaaaa-qaaeq-cai
VITE_LOCAL_CIVIC_BACKEND_CANISTER_ID=b77ix-eeaaa-aaaaa-qaada-cai
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"vite-plugin-environment": "^1.1.3",
"vitest": "^0.32.2"
},
"name": "relying-canister-frontend",
"name": "relying_canister_frontend",
"private": true,
"scripts": {
"build": "tsc && vite build",
Expand All @@ -35,4 +35,4 @@
},
"type": "module",
"version": "0.0.0"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit d3d600d

Please sign in to comment.