Skip to content

Commit

Permalink
chore: add test and build workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Nam Hoang <[email protected]>
  • Loading branch information
namhoang1604 committed Jan 2, 2025
1 parent 1cdfb70 commit 9287770
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 56 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: package
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-[a-z]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-[a-z]+.[0-9]+'
workflow_dispatch:

env:
Expand Down
53 changes: 0 additions & 53 deletions .github/workflows/release-tagging.yml

This file was deleted.

63 changes: 62 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,68 @@ permissions:
contents: write

jobs:
test_and_build:
runs-on: ubuntu-latest
env:
EXCLUDED_PACKAGE_OA_RENDERERS: '!./packages/vckit-oa-renderers/'
EXCLUDED_PACKAGE_CREDENTIAL_OA: '!./packages/credential-oa/'
EXCLUDED_PACKAGE_EXPLORER: '!./packages/demo-explorer/'
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Install pnpm
run: npm i pnpm --global

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

- name: Install dependencies
run: pnpm i --filter ${{ env.EXCLUDED_PACKAGE_OA_RENDERERS }} --filter ${{ env.EXCLUDED_PACKAGE_CREDENTIAL_OA }} --filter ${{ env.EXCLUDED_PACKAGE_EXPLORER }} --no-frozen-lockfile

- name: Build
run: pnpm build:agent

- name: Run tests
run: |
pnpm test:packages --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

build_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
cache: npm
cache-dependency-path: documentation/package-lock.json

- name: Install dependencies
working-directory: ./documentation
run: npm ci

- name: Build website
working-directory: ./documentation
run: npm run build
env:
DOCS_BASE_URL: ${{ vars.DOCS_BASE_URL }}
DOCS_URL: ${{ vars.DOCS_URL }}

release:
needs: [test_and_build, build_docs]
runs-on: ubuntu-latest
outputs:
new_version: ${{ steps.retrieve_version.outputs.new_version }}
Expand Down Expand Up @@ -56,4 +117,4 @@ jobs:
gh release create "$new_tag" \
--title "Release ${{ steps.retrieve_version.outputs.new_version }}" \
--notes-file release_notes.md \
--target ${{ github.ref_name }}
--target ${{ github.ref_name }}

0 comments on commit 9287770

Please sign in to comment.