Skip to content

Commit

Permalink
Merge pull request #299 from Concordium/react-native-compat
Browse files Browse the repository at this point in the history
React native compatibility
  • Loading branch information
soerenbf committed Oct 31, 2023
2 parents 4497a03 + 95af671 commit 14ae952
Show file tree
Hide file tree
Showing 213 changed files with 11,020 additions and 918 deletions.
11 changes: 6 additions & 5 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,17 @@ module.exports = {
2,
{
ignore: [
'@concordium/rust-bindings',
'^@concordium/rust-bindings(/(.*))?$',
'grpc-api',
'^@concordium/web-sdk(/(.*))?$',
'^#.+$', // ESLint resolver does not support subpath imports: https://github.com/import-js/eslint-plugin-import/issues/1868.
],
},
],
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: ['**/*/test/*', '**/*.config.js'],
devDependencies: ['**/*/test/*', '**/*.config.*'],
},
],
'@typescript-eslint/no-unused-vars': [
Expand All @@ -63,9 +64,9 @@ module.exports = {
},
],
ignorePatterns: [
'**/pkg/**/',
'**/dist/**/',
'**/lib/**/',
'**/pkg/**/*',
'**/dist/**/*',
'**/lib/**/*',
'deps/**/*',
'**/src/grpc-api/*',
'typedoc/**',
Expand Down
265 changes: 130 additions & 135 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -1,148 +1,143 @@
name: Deploy

on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
group: "pages"
cancel-in-progress: false

env:
NODE_VERSION: 18.16.0
RUST_VERSION: 1.62
RUST_FMT: nightly-2023-04-01-x86_64-unknown-linux-gnu
NODE_VERSION: 18.16.0
RUST_VERSION: 1.62
RUST_FMT: nightly-2023-04-01-x86_64-unknown-linux-gnu

jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"

- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn

- uses: Swatinem/rust-cache@v2
with:
workspaces: |
packages/rust-bindings
deps/concordium-base/rust-src
deps/concordium-base/concordium-contracts-common
- name: Get wasm-pack
uses: jetli/wasm-pack-action@v0.4.0
with:
version: 'latest'

- name: Cache dependencies
id: yarn-cache
uses: actions/cache@v3
with:
path: |
./node_modules
./docs/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
- name: Cache GRPC
id: cache-grpc
uses: actions/cache@v3
with:
path: |
./packages/sdk/src/grpc-api
key: ${{ runner.os }}-grpc-${{ hashFiles('deps/concordium-base/concordium-grpc-api') }}
restore-keys: ${{ runner.os }}-grpc

- name: Get dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --immutable

- name: Build release
run: yarn build

- name: Store build-release
uses: ./.github/actions/upload-artifact
with:
name: build-release
path: |
./packages/sdk/lib
./packages/sdk/src
./packages/ccd-js-gen/lib
./packages/ccd-js-gen/src
./packages/ccd-js-gen/bin
./packages/rust-bindings/lib
./packages/*/package.json
./packages/*/README.md
build-typedoc:
runs-on: ubuntu-22.04
needs: build
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn

- name: Get build-output
uses: ./.github/actions/download-artifact
with:
name: build-release

- name: Restore cached dependencies
uses: actions/cache/restore@v3
with:
path: |
./node_modules
./docs/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}

- name: Generate typedoc documentation
run: yarn build:docs

- name: Store typedoc
uses: ./.github/actions/upload-artifact
with:
name: typedoc-build
path: typedoc

deploy-typedoc:
needs: build-typedoc
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Get typedoc
uses: ./.github/actions/download-artifact
with:
name: typedoc-build

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload GH pages artifact
uses: actions/upload-pages-artifact@v1
with:
path: './typedoc'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"

- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn

- uses: Swatinem/rust-cache@v2
with:
workspaces: |
packages/rust-bindings
deps/concordium-base/rust-src
deps/concordium-base/concordium-contracts-common
- name: Cache dependencies
id: yarn-cache
uses: actions/cache@v3
with:
path: |
./node_modules
./docs/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
- name: Cache GRPC
id: cache-grpc
uses: actions/cache@v3
with:
path: |
./packages/sdk/src/grpc-api
key: ${{ runner.os }}-grpc-${{ hashFiles('deps/concordium-base/concordium-grpc-api') }}
restore-keys: ${{ runner.os }}-grpc

- name: Get dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --immutable

- name: Build release
run: yarn build

- name: Store build-release
uses: ./.github/actions/upload-artifact
with:
name: build-release
path: |
./packages/sdk/lib
./packages/sdk/src
./packages/ccd-js-gen/lib
./packages/ccd-js-gen/src
./packages/ccd-js-gen/bin
./packages/rust-bindings/lib
./packages/*/package.json
./packages/*/README.md
build-typedoc:
runs-on: ubuntu-22.04
needs: build
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn

- name: Get build-output
uses: ./.github/actions/download-artifact
with:
name: build-release

- name: Restore cached dependencies
uses: actions/cache/restore@v3
with:
path: |
./node_modules
./docs/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}

- name: Generate typedoc documentation
run: yarn build:docs

- name: Store typedoc
uses: ./.github/actions/upload-artifact
with:
name: typedoc-build
path: typedoc

deploy-typedoc:
needs: build-typedoc
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Get typedoc
uses: ./.github/actions/download-artifact
with:
name: typedoc-build

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload GH pages artifact
uses: actions/upload-pages-artifact@v1
with:
path: './typedoc'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
7 changes: 4 additions & 3 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ name: Build, lint and typecheck examples
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [main, release**, feature**]
branches: [ main, release**, feature** ]
pull_request:
branches: [main, release**, feature**]
branches: [ main, release**, feature** ]
# Don't run on draft PR's, see: https://github.com/orgs/community/discussions/25722#discussioncomment-3248917
types: [ opened, synchronize, reopened, ready_for_review ]
# Allows us to run the workflow manually from the Actions tab
workflow_dispatch:


env:
DUMMY: 3 # For cache busting.
NODE_VERSION: 18.16.0
Expand Down Expand Up @@ -140,7 +141,7 @@ jobs:
needs: build
strategy:
matrix:
package: ['sdk', 'ccd-js-gen']
package: [ 'sdk', 'ccd-js-gen' ]
defaults:
run:
working-directory: packages/${{matrix.package}}
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ node_modules
.eslintcache

# Compiled files
lib
**/lib/**/*
target
dist
doc
!packages/rust-bindings/tools/binaryen/lib/**/*

# Auto generate files from the gRPC proto file
grpc-api
Expand Down

0 comments on commit 14ae952

Please sign in to comment.