Skip to content

Commit

Permalink
chore: add smoke test deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
OR13 committed Mar 19, 2021
1 parent db6e11d commit 4366605
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 7 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Pages

on:
push:
branches:
- main

jobs:
release-unstable:
# Don't run on any commit that features [skip ci] in the commit message
if: "! contains(github.event.head_commit.message, '[skip ci]')"
name: Publish unstable release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Use Node 15
uses: actions/setup-node@v1
with:
node-version: 15.x

- name: Install
run: npm install

- name: Build Pages
run: npm run build:pages

- name: Deploy Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
node_modules/
docs/smoke-test-react
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This dirctory is used to serve github pages.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"publish:stable:patch": "lerna publish patch",
"publish:unstable": "lerna publish prerelease --preid unstable --yes",
"release": "lerna publish",
"release:canary": "lerna publish --canary"
"release:canary": "lerna publish --canary",
"build:pages": "rm -rf ./docs/smoke-test-react && lerna run build:smoke-test-react"
},
"devDependencies": {
"husky": "^4.3.8",
Expand Down
5 changes: 4 additions & 1 deletion packages/smoke-test-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "smoke-test-react",
"version": "0.0.4-unstable.16",
"private": true,
"homepage": "https://transmute-industries.github.io/linked-data/smoke-test-react/",
"dependencies": {
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^11.2.5",
Expand All @@ -13,6 +14,7 @@
"@transmute/universal-wallet-did-web-plugin": "0.1.0",
"@transmute/universal-wallet-test-vectors": "0.5.0",
"@transmute/universal-wallet-vc-plugin": "0.5.0",
"@transmute/universal-wallet-edv-plugin": "0.5.0",
"@transmute/web-crypto-key-pair": "^0.0.4-unstable.16",
"factory.ts": "^0.5.1",
"react": "^17.0.1",
Expand All @@ -22,7 +24,8 @@
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"build:smoke-test-react": "CI=false react-scripts build --max_old_space_size=4096",
"postbuild:smoke-test-react": "cp ./build/index.html ./build/404.html && mv ./build ../../docs/smoke-test-react",
"test": "react-scripts test --passWithNoTests",
"eject": "react-scripts eject"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ import * as Wallet from "@transmute/universal-wallet";
import * as DidKey from "@transmute/universal-wallet-did-key-plugin";
import * as DidWeb from "@transmute/universal-wallet-did-web-plugin";
import * as Vc from "@transmute/universal-wallet-vc-plugin";
import * as Edv from "@transmute/universal-wallet-edv-plugin";

const customWalletFactory = Factory.Sync.makeFactory({
...Wallet.walletDefaults,
...DidKey.factoryDefaults,
...DidWeb.factoryDefaults,
...Vc.factoryDefaults,
...Edv.factoryDefaults,
})
.combine(Wallet.walletFactory)
.combine(DidKey.pluginFactory)
.combine(DidWeb.pluginFactory)
.combine(Vc.pluginFactory);
.combine(Vc.pluginFactory)
.combine(Edv.pluginFactory);

export { customWalletFactory };
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ const testDidWeb = async (wallet) => {
await wallet.generate("https://example.com/organizations/123/did.json");
};

const testEdv = async (wallet) => {
const client = await wallet.vaultClientFromPassord(
"https://staging.data-vault.transmute.industries/edvs",
"123"
);
wallet.vault = { endpoint: client.vault_endpoint };
};

const testVc = async (wallet) => {
// issue credential from generated keys
const c1 = await issue(wallet);
Expand All @@ -43,6 +51,7 @@ function App() {
await testDidKey(wallet);
await testDidWeb(wallet);
await testVc(wallet);
await testEdv(wallet);

setState({
wallet,
Expand Down
6 changes: 3 additions & 3 deletions packages/universal-wallet-edv-plugin/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Factory from 'factory.ts';
import * as Factory from "factory.ts";

import { VaultClientConfig } from './types';
import { VaultClient } from './vault-client';
import { VaultClientConfig } from "./types";
import { VaultClient } from "./vault-client";

interface EdvPlugin {
vaultClientFromDerivedContents: (
Expand Down

0 comments on commit 4366605

Please sign in to comment.