Skip to content

Commit

Permalink
✨ Add PassportIssuer subgraph
Browse files Browse the repository at this point in the history
📌 Pin dependencies and build

📝 Add local testing guide

💚 Add `codegen` command

📄 Add license to `package.json`

💚 Fixing `npm` step

✅ Fix test event setups

✅ Add `Revoke` test

📝 Add more info on  unit testing
  • Loading branch information
acemasterjb committed Jan 5, 2024
1 parent 0e0bb53 commit 5d4ab86
Show file tree
Hide file tree
Showing 10 changed files with 732 additions and 34 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,21 @@ on:

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
node-version: [16.x, 18.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
runs-on: ${{ matrix.os }}

runs-on: ubuntu-latest
defaults:
run:
working-directory: passportissuance
working-directory: ./passportissuance

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: passportissuance/package-lock.json
node-version: '20.x'
- run: npm install

- run: nom run build
- run: npm run codegen
- run: npm run build
- run: npm run test
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,33 @@ Refer to the following guide from [The Graph's docs](https://thegraph.com/docs/e
## Contributing

Refer to [this document from The Graph's docs](https://thegraph.com/docs/en/developing/creating-a-subgraph/) on how to set up your development environment for making changes to, and deploying new, subgraphs.

## Testing

Two options are available for testing:

1. [Local Graph deployment (integration testing)](/#Local)
2. [Matchstick unit tests](/#Matchstick)

### Local

To test your changes to the subgraph locally you will need a local IPFS Gateway for the subgraph to deploy files to.

Refer to [this guide](https://docs.ipfs.tech/how-to/command-line-quick-start/) to learn how to do so and ensure your gateway points to `http://localhost:5001`.

Then run the following commands in the subgraph's directory (e.g. the [PassportIssuer](./passportissuance/) subgraph directory):

```console
npm run codegen
npm run build
npm run create-local
npm run deploy-local
```

### [Matchstick](https://github.com/LimeChain/matchstick/blob/main/README.md)

Simply run the following command to run the available tests in their respective subgraph directories (e.g. [PassportIssuer](./passportissuance/)):

```console
npm run test
```
Binary file not shown.
Loading

0 comments on commit 5d4ab86

Please sign in to comment.