Skip to content

Commit

Permalink
Merge branch 'main' into style(frontend)/changes-footer-copyright-text
Browse files Browse the repository at this point in the history
  • Loading branch information
BonomoAlessandro authored Nov 19, 2024
2 parents 2eb83cb + 7a6c395 commit fb0b408
Show file tree
Hide file tree
Showing 162 changed files with 3,073 additions and 841 deletions.
2 changes: 1 addition & 1 deletion .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ runs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
registry-url: 'https://registry.npmjs.org'
cache: 'npm'

Expand Down
49 changes: 35 additions & 14 deletions .github/workflows/deploy-to-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ on:
options:
- staging
- beta
- test_fe_1
- test_fe_2
- test_fe_3
- test_fe_4
- test_be_1
canister:
required: true
type: choice
Expand Down Expand Up @@ -41,17 +46,6 @@ jobs:
runs-on: ubuntu-24.04

steps:
- name: Fail if branch is not main
if: ${{ github.ref != 'refs/heads/main' }}
run: |
echo "This workflow can only be manually triggered with workflow_dispatch on the main branch"
exit 1
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Determine Deployment Network
run: |
if [ "${{ github.event_name }}" == "push" ]; then
Expand All @@ -62,25 +56,51 @@ jobs:
echo "CANISTER=${{ github.event.inputs.canister }}" >> $GITHUB_ENV
fi
- name: Check release policy
run: |
if [[ "$NETWORK" == "staging" ]] && [[ "${{ github.ref }}" != "refs/heads/main" ]] ; then
echo "Only the main branch may be deployed to staging."
exit 1
fi
if [[ "$NETWORK" = test_fe_* ]] && [[ "$CANISTER" != "frontend" ]] ; then
echo "Only a frontend may be deployed to test_fe_* networks"
exit 1
fi
if [[ "$NETWORK" = test_be_* ]] && [[ "$CANISTER" != "backend" ]] ; then
echo "Only a backend may be deployed to test_be_* networks"
exit 1
fi
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Set Environment Variables Based on Network
run: |
if [ "$NETWORK" == "staging" ]; then
if [[ "$NETWORK" == "staging" ]] || [[ "$NETWORK" = test_fe_* ]]; then
echo "VITE_ETHERSCAN_API_KEY=${{ secrets.VITE_ETHERSCAN_API_KEY_STAGING }}" >> $GITHUB_ENV
echo "VITE_INFURA_API_KEY=${{ secrets.VITE_INFURA_API_KEY_STAGING }}" >> $GITHUB_ENV
echo "VITE_ALCHEMY_API_KEY=${{ secrets.VITE_ALCHEMY_API_KEY_STAGING }}" >> $GITHUB_ENV
echo "VITE_WALLET_CONNECT_PROJECT_ID=${{ secrets.VITE_WALLET_CONNECT_PROJECT_ID_STAGING }}" >> $GITHUB_ENV
echo "VITE_OISY_URL=${{ secrets.VITE_OISY_URL_STAGING }}" >> $GITHUB_ENV
echo "VITE_AIRDROP=${{ secrets.VITE_AIRDROP_STAGING }}" >> $GITHUB_ENV
echo "VITE_AIRDROP_COMPLETED=${{ secrets.VITE_AIRDROP_COMPLETED_STAGING }}" >> $GITHUB_ENV
echo "VITE_COINGECKO_API_KEY=${{ secrets.VITE_COINGECKO_API_KEY_STAGING }}" >> $GITHUB_ENV
echo "VITE_JUNO_SATELLITE_ID=${{ secrets.VITE_JUNO_SATELLITE_ID_STAGING }}" >> $GITHUB_ENV
echo "VITE_JUNO_ORBITER_ID=${{ secrets.VITE_JUNO_ORBITER_ID_STAGING }}" >> $GITHUB_ENV
echo "VITE_POUH_ENABLED=${{ secrets.VITE_POUH_ENABLED_STAGING }}" >> $GITHUB_ENV
echo "VITE_AUTH_ALTERNATIVE_ORIGINS=${{ secrets.VITE_AUTH_ALTERNATIVE_ORIGINS_STAGING }}" >> $GITHUB_ENV
echo "VITE_AUTH_DERIVATION_ORIGIN=${{ secrets.VITE_AUTH_DERIVATION_ORIGIN_STAGING }}" >> $GITHUB_ENV
echo "VITE_BTC_TO_CKBTC_EXCHANGE_ENABLED=${{ secrets.VITE_BTC_TO_CKBTC_EXCHANGE_ENABLED_STAGING }}" >> $GITHUB_ENV
echo "VITE_ONRAMPER_API_KEY_DEV=${{ secrets.VITE_ONRAMPER_API_KEY_DEV_STAGING }}" >> $GITHUB_ENV
echo "VITE_ONRAMPER_API_KEY_PROD=${{ secrets.VITE_ONRAMPER_API_KEY_PROD_STAGING }}" >> $GITHUB_ENV
if [[ "$NETWORK" == "staging" ]]; then
echo "VITE_AUTH_ALTERNATIVE_ORIGINS=${{ secrets.VITE_AUTH_ALTERNATIVE_ORIGINS_STAGING }}" >> $GITHUB_ENV
echo "VITE_OISY_URL=${{ secrets.VITE_OISY_URL_STAGING }}" >> $GITHUB_ENV
else
SUBDOMAIN="fe${NETWORK#test_fe_}" # E.g. test_fe_1 -> fe1
echo "VITE_AUTH_ALTERNATIVE_ORIGINS=${{ secrets.VITE_AUTH_ALTERNATIVE_ORIGINS_STAGING }}" | sed "s/staging/$SUBDOMAIN/g" >> $GITHUB_ENV
echo "VITE_OISY_URL=${{ secrets.VITE_OISY_URL_STAGING }}" | sed "s/staging/$SUBDOMAIN/g" >> $GITHUB_ENV
fi
{
echo 'DFX_DEPLOY_KEY<<EOF'
echo "${{ secrets.DFX_DEPLOY_KEY_STAGING }}"
Expand Down Expand Up @@ -142,6 +162,7 @@ jobs:
dfx identity import --disable-encryption --force default "$key_pem"
rm "$key_pem"
dfx identity use default
dfx identity get-principal
- name: Pre-build
run: npm run build
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,17 @@ jobs:
exit 1
fi
check-pr-description:
name: 'check-pr-description:required'
runs-on: ubuntu-24.04
env:
DESCRIPTION: ${{ github.event.pull_request.body }}
steps:
- name: 'Check PR Description for Jira/Atlassian Links'
run: |
if [[ "$DESCRIPTION" =~ https:\/\/[a-zA-Z0-9]*\.(atlassian|jira)\.[a-z]{2,3} ]]; then
echo "PR Description contains a link to Jira or Atlassian, which is not allowed."
exit 1
else
echo "PR Description passes"
fi
4 changes: 4 additions & 0 deletions .github/workflows/update-snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- main
pull_request:
types: [ opened, synchronize, labeled ]
workflow_dispatch:

concurrency:
Expand All @@ -14,6 +16,7 @@ jobs:

oisy-backend-wasm:
runs-on: ubuntu-24.04
if: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-e2e-snapshots') }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -23,6 +26,7 @@ jobs:

update_snapshots:
runs-on: ubuntu-24.04
if: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-e2e-snapshots') }}
needs: oisy-backend-wasm
steps:

Expand Down
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.11.0
14 changes: 7 additions & 7 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[workspace]
members = [
"src/backend",
"src/cycles_ledger_client",
"src/cycles_ledger/client",
"src/shared"
]
resolver = "2"
Expand All @@ -10,9 +10,9 @@ resolver = "2"
ic-cdk = "0.16.0"
ic-cdk-macros = "0.16.0"
ic-cdk-timers = "0.9.0"
ic-cycles-ledger-client = { path = "src/cycles_ledger_client" }
ic-cycles-ledger-client = { path = "src/cycles_ledger/client" }
ic-ledger-types = "0.13.0"
ic-stable-structures = "0.6.5"
ic-stable-structures = "0.6.6"
ic-metrics-encoder = "1.1.1"
ic-canister-sig-creation = "1.1.0"
ic-verifiable-credentials = { git = "https://github.com/dfinity/verifiable-credentials-sdk", rev = "a116a2e53a13e4a1f6f7e8429960a7d0d6142e70" }
Expand Down
20 changes: 16 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y \

RUN curl --proto '=https' --tlsv1.2 -L https://github.com/mikefarah/yq/releases/download/v4.33.3/yq_linux_amd64 | install -m 755 /dev/stdin /bin/yq && yq --version | grep yq

# Install node
RUN curl --fail -sSf https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
ENV NVM_DIR=/root/.nvm
COPY .node-version .node-version
RUN . "$NVM_DIR/nvm.sh" && nvm install "$(cat .node-version)"
RUN . "$NVM_DIR/nvm.sh" && nvm use "v$(cat .node-version)"
RUN . "$NVM_DIR/nvm.sh" && nvm alias default "v$(cat .node-version)"
RUN ln -s "$NVM_DIR/versions/node/v$(cat .node-version)" "$NVM_DIR/versions/node/default"
ENV PATH="$NVM_DIR/versions/node/default/bin/:${PATH}"
RUN node --version
RUN npm --version

# Install Rust and Cargo in /opt
ENV RUSTUP_HOME=/opt/rustup \
CARGO_HOME=/cargo \
Expand All @@ -38,13 +50,13 @@ RUN ./docker/bootstrap
COPY Cargo.lock .
COPY Cargo.toml .
COPY src/backend/Cargo.toml src/backend/Cargo.toml
COPY src/cycles_ledger_client/Cargo.toml src/cycles_ledger_client/Cargo.toml
COPY src/cycles_ledger/client/Cargo.toml src/cycles_ledger/client/Cargo.toml
COPY src/shared/Cargo.toml src/shared/Cargo.toml
ENV CARGO_TARGET_DIR=/cargo_target
RUN mkdir -p src/backend/src \
&& touch src/backend/src/lib.rs \
&& mkdir -p src/cycles_ledger_client/src \
&& touch src/cycles_ledger_client/src/lib.rs \
&& mkdir -p src/cycles_ledger/client/src \
&& touch src/cycles_ledger/client/src/lib.rs \
&& mkdir -p src/shared/src \
&& touch src/shared/src/lib.rs \
&& ./docker/build --only-dependencies \
Expand All @@ -54,7 +66,7 @@ FROM deps AS build_backend

COPY . .

RUN touch src/*/src/lib.rs
RUN touch src/*/src/lib.rs src/*/*/src/lib.rs

RUN ./docker/build --backend

Expand Down
9 changes: 4 additions & 5 deletions Dockerfile.frontend
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y \
# Install node
RUN curl --fail -sSf https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
ENV NVM_DIR=/root/.nvm
COPY .nvmrc .node-version
RUN cat .node-version
COPY .node-version .node-version
RUN . "$NVM_DIR/nvm.sh" && nvm install "$(cat .node-version)"
RUN . "$NVM_DIR/nvm.sh" && nvm use "$(cat .node-version)"
RUN . "$NVM_DIR/nvm.sh" && nvm alias default "$(cat .node-version)"
RUN ln -s "$NVM_DIR/versions/node/$(cat .node-version)" "$NVM_DIR/versions/node/default"
RUN . "$NVM_DIR/nvm.sh" && nvm use "v$(cat .node-version)"
RUN . "$NVM_DIR/nvm.sh" && nvm alias default "v$(cat .node-version)"
RUN ln -s "$NVM_DIR/versions/node/v$(cat .node-version)" "$NVM_DIR/versions/node/default"
ENV PATH="$NVM_DIR/versions/node/default/bin/:${PATH}"
RUN node --version
RUN npm --version
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit fb0b408

Please sign in to comment.