Skip to content

fix(mrtd): missing problem report handler registration (#64) #127

fix(mrtd): missing problem report handler registration (#64)

fix(mrtd): missing problem report handler registration (#64) #127

name: Continuous Integration
on:
pull_request:
branches: [main]
types: [opened, synchronize, reopened, labeled]
push:
branches: [main]
# Make sure we're not running multiple release steps at the same time as this can give issues with determining the next npm version to release.
# Ideally we only add this to the 'release' job so it doesn't limit PR runs, but github can't guarantee the job order in that case:
# "When concurrency is specified at the job level, order is not guaranteed for jobs or runs that queue within 5 minutes of each other."
concurrency:
group: credo-ts-didcomm-${{ github.ref }}-${{ github.repository }}-${{ github.event_name }}
cancel-in-progress: true
permissions:
contents: write
pull-requests: write
jobs:
ci-trigger:
runs-on: ubuntu-20.04
outputs:
triggered: ${{ steps.check.outputs.triggered }}
steps:
- name: Determine if CI should run
id: check
run: |
if [[ "${{ github.event.action }}" == "labeled" && "${{ github.event.label.name }}" == "ci-test" ]]; then
export SHOULD_RUN='true'
elif [[ "${{ github.event.action }}" == "labeled" && "${{ github.event.label.name }}" != "ci-test" ]]; then
export SHOULD_RUN='false'
else
export SHOULD_RUN='true'
fi
echo "SHOULD_RUN: ${SHOULD_RUN}"
echo "::set-output name=triggered::${SHOULD_RUN}"
validate:
runs-on: ubuntu-20.04
name: Validate
needs: [ci-trigger]
if: needs.ci-trigger.outputs.triggered == 'true'
steps:
- name: Checkout credo-ts-didcomm-ext
uses: actions/checkout@v4
- name: Setup node v20
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org/'
cache: yarn
# Ignore scripts so we don't need libindy setup
- name: Install dependencies
run: yarn install --ignore-scripts
- name: Linting
run: yarn lint
- name: Prettier
run: yarn check-format
- name: Compile
run: yarn check-types
integration-test:
runs-on: ubuntu-20.04
name: Integration Tests
needs: [ci-trigger]
if: needs.ci-trigger.outputs.triggered == 'true'
strategy:
matrix:
node-version: [20.x]
steps:
- name: Checkout credo-ts-didcomm-ext
uses: actions/checkout@v4
- name: Setup node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org/'
cache: yarn
- name: Install dependencies
run: yarn install
- name: Run tests
run: yarn test --coverage
- uses: codecov/codecov-action@v5
if: always()
release-please:
runs-on: ubuntu-latest
needs: [integration-test, validate]
outputs:
releases_created: ${{ steps.release-please.outputs.releases_created }}
paths_released: ${{ steps.release-please.outputs.paths_released }}
steps:
- uses: googleapis/release-please-action@v4
id: release-please
with:
path: ./packages
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
token: ${{ secrets.GITHUB_TOKEN }}
- name: Print release outputs for debugging
continue-on-error: true
run: |
echo "Release outputs:"
echo ${{ toJson(steps.release-please.outputs) }}
# Initiate release process if release was created
release-package:
if: ${{needs.release-please.outputs.releases_created}}
runs-on: ubuntu-latest
needs: [release-please]
strategy:
fail-fast: false
matrix:
package: ${{fromJson(needs.release-please.outputs.paths_released)}}
steps:
- name: Checkout credo-ts-didcomm-ext
uses: actions/checkout@v4
- name: Setup node v20
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org/'
cache: yarn
# Ignore scripts so we don't need libindy setup
- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-scripts
- name: Release to NPM
run: npm publish ./${{ matrix.package }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}