Skip to content

2.7.2 (#595)

2.7.2 (#595) #1728

Workflow file for this run

# This is the entry point for CI. It will setup the application, then run lint, test, and eventually publish if not the main branch
name: 'Main'
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
concurrency: build-${{ github.ref}}
if: ${{ !startsWith(github.head_ref, 'version-bump') }}
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup
- run: yarn build
lint:
runs-on: ubuntu-latest
concurrency: lint-${{ github.ref }}
if: ${{ !startsWith(github.head_ref, 'version-bump') }}
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup
- run: yarn lint
test:
concurrency: test-${{ github.ref }}
runs-on: ubuntu-latest
if: ${{ !startsWith(github.head_ref, 'version-bump') }}
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup
- run: |
# Check for test.only() in test files
set +e
files=$(find ${{ github.workspace }}/test -name "*.test.ts" | xargs grep -l 'test.only')
set -e
if [[ -n $files ]]; then
echo "Error: Found /test.only/ in following test files:"
echo "$files"
exit 1
fi
- run: yarn test
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: coverage-reports
path: |
./**/coverage/tmp/*.json
./**/coverage/coverage-summary.json
# Only run if tests have run and completed successfully
code-coverage:
needs: test
runs-on: ubuntu-latest
if: ${{ !startsWith(github.head_ref, 'version-bump') }}
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: coverage-reports
- run: yarn code-coverage
- uses: ./.github/actions/set-git-credentials
- name: Save coverage summary
if: github.event.pull_request.number # check if the context is pull request
run: |
# save coverage summary in a branch 'coverage-pr-PR_NUMBER' so we can have access to it in a different workflow
BRANCH="coverage-pr-${{ github.event.pull_request.number }}"
git checkout -b $BRANCH
git add -f coverage/coverage-summary.json
git commit -m "coverage summary report"
git push --set-upstream origin $BRANCH --force
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
generate-example-adapter:
runs-on: ubuntu-latest
if: ${{ !startsWith(github.head_ref, 'version-bump') }}
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup
- name: Generate new adapter, build, run the tests
run: |
yarn build
path_to_generator="$GITHUB_WORKSPACE/dist/src/generator-adapter/generators/app/index.js"
npm install -g [email protected]
# The command bellow will generate new EA with default name 'example-adapter' in specified directory 'examples'
DEBUG=* yo "$path_to_generator" examples
cd examples/example-adapter
yarn build
yarn test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EXTERNAL_ADAPTER_GENERATOR_NO_INTERACTIVE: 'true'
EXTERNAL_ADAPTER_GENERATOR_STANDALONE: 'true'