Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs/semantic interoperability testing #1

Closed
wants to merge 12 commits into from
Closed
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
16 changes: 5 additions & 11 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
{
"root": true,
"plugins": [
"@typescript-eslint",
"prettier"
],
"plugins": ["@typescript-eslint", "prettier"],
// TODO: Enable linting for documentation folder
"ignorePatterns": ["documentation"],
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
],
"parserOptions": {
"project": [
"./packages/tsconfig.settings.json",
"./packages/*/tsconfig.json"
]
"project": ["./packages/tsconfig.settings.json", "./packages/*/tsconfig.json"]
},
"rules": {
"no-console": "warn",
Expand All @@ -30,9 +26,7 @@
},
"overrides": [
{
"files": [
"*.js"
],
"files": ["*.js"],
"rules": {
"@typescript-eslint/no-var-requires": "off"
}
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and Test

on:
pull_request:
branches:
- next

jobs:
test_and_build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Enable Corepack
run: corepack enable

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '21'
cache: 'yarn'

- name: Install dependencies
run: |
yarn cache clean && yarn install --immutable

- name: Check linting
run: yarn lint

- name: Run tests
run: |
yarn jest --changedSince=origin/next --ci --json --coverage --testLocationInResults --outputFile=report.json

- name: Coverage
uses: artiomtr/jest-coverage-report-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
coverage-file: report.json
base-coverage-file: report.json
threshold: 80

- name: Build
run: yarn build
37 changes: 37 additions & 0 deletions .github/workflows/buld_publish_docs.yml.disabled
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# TODO: Enable once tagging is enabled
name: Deploy to GitHub Pages

on:
push:
branches:
- main

jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
cache: yarn

- name: Install dependencies
run: cd documentation && yarn install --frozen-lockfile
- name: Build website
run: cd documentation && yarn build

# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./documentation/build
# The following lines assign commit authorship to the official
# GH-Actions bot for deploys to `gh-pages` branch:
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
# The GH actions bot is used by default if you didn't specify the two fields.
# You can swap them out with your own user credentials.
51 changes: 51 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: package

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:

env:
CI: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: docker meta details
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{github.repository}}
flavor: |
latest=auto
tags: |
type=edge,branch=next
type=semver,pattern={{version}}
type=sha

- name: Set up Docker
uses: docker/setup-buildx-action@v3

- name: Login to Github Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push Release
uses: docker/build-push-action@v5
with:
push: ${{ startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/next' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
target: build
build-args: |
CONFIG_FILE=./app-config.json


53 changes: 53 additions & 0 deletions .github/workflows/release-tagging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Release Tagging

on:
push:
branches:
- main

jobs:
tagging:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get version from package.json
id: get_version
run: |
version=$(jq -r '.version // empty' < package.json)
if [ -z "$version" ]; then
echo "No valid version found in package.json."
exit 1
fi
echo "::set-output name=version::$version"

- name: Check if tag already exists
id: check_tag
run: |
version=${{ steps.get_version.outputs.version }}
if git rev-parse "v$version" >/dev/null 2>&1; then
echo "Tag v$version already exists."
echo "::set-output name=exists::true"
exit 0
else
echo "::set-output name=exists::false"
fi

- name: Create and push tag
if: steps.check_tag.outputs.exists == 'false'
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag -a "v${{ steps.get_version.outputs.version }}" -m "Release version ${{ steps.get_version.outputs.version }}"
git push origin "v${{ steps.get_version.outputs.version }}"

- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
tag: "v${{ steps.get_version.outputs.version }}"
name: "Release ${{ steps.get_version.outputs.version }}"
generateReleaseNotes: true
prerelease: false

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,6 @@ packages/services/tsconfig.tsbuildinfo
packages/mock-app/src/constants/app-config.json
packages/untp-test-suite/credentials.json
packages/untp-test-suite/data
# vc-test-suite
packages/vc-test-suite/suite.log
packages/vc-test-suite/reports
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ UNTP mock implementation is a mock app that presents how the decentralized app w
- [Node.js](https://nodejs.org/en/) version 20.12.2
- [yarn](https://yarnpkg.com/) version 1.22.22

## Install dependencies
### Install dependencies

```bash
yarn install
```

## Copy the .app-config.example file to .env for the demo explorer
### Copy the .app-config.example file to .env for the demo explorer

```bash
cp packages/mock-app/src/constants/app-config.example.json packages/mock-app/src/constants/app-config.json
Expand Down Expand Up @@ -65,18 +65,36 @@ cp packages/mock-app/src/constants/app-config.example.json packages/mock-app/src
}
```

## Build the package
### Build the package

```bash
yarn build
```

## Start the project
### Start the project

```bash
yarn start
```

## Documentation

```
$ cd documentation
```

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

## Docker

- Dockerfile
Expand Down
Loading