Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

ci: optimize builds #5

Merged
merged 3 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/actions/use-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Use Dependencies"

description: "Checks if the dependencies have been cached with the hash of the yarn.lock file."

runs:
using: "composite"
steps:
- name: "πŸ”§ Setup"
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'yarn'
- name: "πŸ’Ύ Cache dependencies"
uses: actions/cache@v3
id: cache-dependencies
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('yarn.lock') }}
- name: "πŸ“¦ Install"
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: yarn install --ignore-scripts
shell: bash
20 changes: 0 additions & 20 deletions .github/workflows/build_documentation.yml

This file was deleted.

23 changes: 14 additions & 9 deletions .github/workflows/deploy_documentation.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
name: Deploy Documentation
name: "Deploy Documentation"

on:
push:
branches:
- main

jobs:
install:
name: "Install"
runs-on: ubuntu-latest
steps:
- name: "πŸ›Ž Checkout"
uses: actions/checkout@v3
- name: "πŸ”§ Setup"
uses: ./.github/actions/use-dependencies

deploy:
name: Deploy
name: "Deploy"
needs: install
runs-on: ubuntu-latest
steps:
- name: "πŸ›Ž Checkout"
uses: actions/checkout@v3
- name: "πŸ”§ Setup"
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: yarn
- name: "πŸ“¦ Install"
run: yarn install --ignore-scripts --frozen-lockfile
uses: ./.github/actions/use-dependencies
- name: "πŸ—οΈ Build"
run: yarn docs:build
- name: "πŸš€ Deploy"
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.WRITE_REPOS_TOKEN }}
publish_dir: ./.docs
user_name: agoralabs-bot
user_email: tech@agoralabs.sh
24 changes: 0 additions & 24 deletions .github/workflows/lint_build_test.yml

This file was deleted.

70 changes: 70 additions & 0 deletions .github/workflows/pull_request_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: "Pull Request Checks"

on:
pull_request:

jobs:
##
# install
##

install:
name: "Install"
runs-on: ubuntu-latest
steps:
- name: "πŸ›Ž Checkout"
uses: actions/checkout@v3
- name: "πŸ”§ Setup"
uses: ./.github/actions/use-dependencies

##
# lint, build documentation, build package and test
##

lint:
name: "Lint"
needs: install
runs-on: ubuntu-latest
steps:
- name: "πŸ›Ž Checkout"
uses: actions/checkout@v3
- name: "πŸ”§ Setup"
uses: ./.github/actions/use-dependencies
- name: "πŸ‘• Lint"
run: yarn lint

build_documenation:
name: "Build Documentation"
needs: install
runs-on: ubuntu-latest
steps:
- name: "πŸ›Ž Checkout"
uses: actions/checkout@v3
- name: "πŸ”§ Setup"
uses: ./.github/actions/use-dependencies
- name: "πŸ—οΈ Build"
run: yarn docs:build

build_pakage:
name: "Build Package"
needs: install
runs-on: ubuntu-latest
steps:
- name: "πŸ›Ž Checkout"
uses: actions/checkout@v3
- name: "πŸ”§ Setup"
uses: ./.github/actions/use-dependencies
- name: "πŸ—οΈ Build"
run: yarn build

test:
name: "Test"
needs: install
runs-on: ubuntu-latest
steps:
- name: "πŸ›Ž Checkout"
uses: actions/checkout@v3
- name: "πŸ”§ Setup"
uses: ./.github/actions/use-dependencies
- name: "πŸ§ͺ Test"
run: yarn test
30 changes: 22 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: "Release"

on:
push:
Expand All @@ -7,23 +7,37 @@ on:
- main

jobs:
release:
name: Release
##
# install
##

install:
name: "Install"
runs-on: ubuntu-latest
steps:
- name: "πŸ›Ž Checkout"
uses: actions/checkout@v3
- name: "πŸ”§ Setup"
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
uses: ./.github/actions/use-dependencies

##
# release
##

release:
name: "Release"
needs: install
runs-on: ubuntu-latest
steps:
- name: "πŸ›Ž Checkout"
uses: actions/checkout@v3
- name: "πŸ“ Create .npmrc"
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.PUBLISH_PUBLIC_PACKAGES_TOKEN }}" >> .npmrc
echo "@agoralabs-sh:registry=https://registry.npmjs.org" >> .npmrc
echo "access=public" >> .npmrc
- name: "πŸ“¦ Install"
run: yarn install --ignore-scripts
- name: "πŸ”§ Setup"
uses: ./.github/actions/use-dependencies
- name: "πŸ—οΈ Build"
run: yarn build
- name: "πŸ”– Release"
Expand Down
6 changes: 3 additions & 3 deletions docs/api-reference/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# API Reference

* [`AlgorandProvider`](algorand-provider) - injected as `window.algorand` by wallets and is used by dApps to interact with any installed wallets.
* [`BaseWalletManger`](base-wallet-manager) - the interface for wallets.
* [`Errors`](errors) - various error responses that can be thrown.
* [`AlgorandProvider`](api-reference/algorand-provider) - injected as `window.algorand` by wallets and is used by dApps to interact with any installed wallets.
* [`BaseWalletManger`](api-reference/base-wallet-manager) - the interface for wallets.
* [`Errors`](api-reference/errors) - various error responses that can be thrown.
14 changes: 7 additions & 7 deletions docs/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

For dApp developers.

* [Initialization](dapps/initialization)
* [Enabling a wallet](dapps/enabling-a-wallet)
* [Signing transactions](dapps/signing-transactions)
* [Sending transactions](dapps/sending-transactions)
* [Signing data](dapps/signing-data)
* [Initialization](getting-started/dapps/initialization)
* [Enabling a wallet](getting-started/dapps/enabling-a-wallet)
* [Signing transactions](getting-started/dapps/signing-transactions)
* [Sending transactions](getting-started/dapps/sending-transactions)
* [Signing data](getting-started/dapps/signing-data)

## Wallets

For wallets.

* [Installation](wallets/installation)
* [Usage](wallets/usage)
* [Installation](getting-started/wallets/installation)
* [Usage](getting-started/wallets/usage)
4 changes: 2 additions & 2 deletions src/errors/NetworkNotSupportedError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { ErrorCodeEnum } from '../enums';
// Errors
import BaseError from './BaseError';

export default class NetworkNotSupported extends BaseError {
export default class NetworkNotSupportedError extends BaseError {
public readonly code: ErrorCodeEnum = ErrorCodeEnum.NetworkNotSupportedError;
public readonly genesisHash: string;
public readonly name: string = 'NetworkNotSupported';
public readonly name: string = 'NetworkNotSupportedError';

constructor(genesisHash: string, message?: string) {
super(
Expand Down