bump axios to 1.6.0 (#239) #616
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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@v3 | |
- 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@v3 | |
- uses: ./.github/actions/setup | |
- run: yarn lint | |
- run: yarn prettier --check "**/*.{ts,md}" | |
test: | |
concurrency: test-${{ github.ref }} | |
runs-on: ubuntu-latest | |
if: ${{ !startsWith(github.head_ref, 'version-bump') }} | |
steps: | |
- uses: actions/checkout@v3 | |
- 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@v3 | |
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@v3 | |
- uses: ./.github/actions/setup | |
- uses: actions/download-artifact@v3 | |
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@v3 | |
- uses: ./.github/actions/setup | |
- name: Generate new adapter, build, run the tests | |
run: | | |
yarn build | |
path_to_generator="$GITHUB_WORKSPACE/dist/src/generator-adapter" | |
npm install -g yo@4.3.1 | |
# The command bellow will generate new EA with default name 'example-adapter' in specified directory 'examples' | |
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' |