Skip to content

Commit

Permalink
rework ci workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjah committed Aug 1, 2024
1 parent ae0ffca commit 7f129d9
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 12 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/node.js.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Formater and linter
name: Build

on:
[push]
push:
workflow_call:

jobs:
build:
Expand All @@ -26,4 +27,10 @@ jobs:
- name: Build package
run: npm run build

- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: build-artifacts
path: ./dist


Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
name: CI unit tests
on: [push]
name: MassaStation e2e tests

on:
push:
workflow_call:

jobs:
tests-e2e:
build:
uses: ./.github/workflows/build.yml

massaStation-tests-e2e:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3

Expand All @@ -17,8 +25,11 @@ jobs:
npm ci
sudo apt install xvfb libnss3-tools libwebkit2gtk-4.0-dev
- name: Build bundle
run: npm run build
- name: Download build artifacts
uses: actions/download-artifact@v2
with:
name: build-artifacts
path: ./dist

- name: Download MassaStation
run: |
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/npm-publish-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ on:
branches: [ main ]

jobs:
test:
uses: ./.github/workflows/massaStation-e2e-tests.yml
publish-npm-dev:

runs-on: ubuntu-latest
needs: test

steps:
- name: Checkout code
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/npm-publish-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ on:
branches: [next]

jobs:
publish-npm-dev:
test:
uses: ./.github/workflows/massaStation-e2e-tests.yml
publish-npm-next:

runs-on: ubuntu-latest
needs: test

steps:
- name: Checkout code
Expand Down
4 changes: 2 additions & 2 deletions src/bearbyWallet/BearbyAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class BearbyAccount implements Provider {
const res = await web3.massa.getAddresses(this.address);

if (res.error) {
throw new Error(res.error?.message || 'Bearby unknown error');
throw new Error(res.error?.message || 'Bearby getAddresses error');
}

// TODO: fix typings in bearby.js to avoid this cast
Expand Down Expand Up @@ -235,7 +235,7 @@ export class BearbyAccount implements Provider {
const res = await web3.massa.getOperations(opId);

if (res.error) {
throw new Error(res.error?.message || 'Bearby unknown error');
throw new Error(res.error?.message || 'Bearby getOperations error');
}
const op = res.result[0] as any;
if (op.op_exec_status === null) {
Expand Down
8 changes: 6 additions & 2 deletions src/bearbyWallet/utils/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ import { Network } from '@massalabs/massa-web3';
export const networkInfos = async (): Promise<Network> => {
const { net } = await web3.wallet.network;
// TODO: fix bearby.js typings
const { result } = (await web3.massa.getNodesStatus()) as any;
const res = await web3.massa.getNodesStatus() as any;
if (res.error) {
throw new Error(res.error?.message || 'Bearby getNodesStatus error');
}

return {
name: net,
chainId: result.chain_id,
chainId: res.result.chain_id,
};
};

0 comments on commit 7f129d9

Please sign in to comment.