Release 0.0.0 #200
This file contains hidden or 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
name: ci | |
on: [push] | |
jobs: | |
compile: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Set up node | |
uses: actions/setup-node@v3 | |
- name: Compile | |
run: | | |
yarn install | |
echo 'Adding resolutions to package.json...' | |
node -e " | |
const fs = require('fs'); | |
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); | |
pkg.resolutions = { '@types/babel__traverse': '7.20.6' }; | |
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2)); | |
" | |
yarn install --force | |
yarn build | |
unit-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Set up node | |
uses: actions/setup-node@v3 | |
- name: Install dependencies and fix TypeScript compatibility | |
run: | | |
yarn install | |
echo 'Adding resolutions to package.json...' | |
node -e " | |
const fs = require('fs'); | |
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); | |
pkg.resolutions = { '@types/babel__traverse': '7.20.6' }; | |
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2)); | |
" | |
yarn install --force | |
- name: Unit Test | |
run: yarn jest tests/unit | |
integration-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Set up node | |
uses: actions/setup-node@v3 | |
- name: Install dependencies | |
run: yarn install | |
- name: Integration Server Test (with retries) | |
env: | |
VOYAGE_API_KEY: ${{ secrets.VOYAGE_API_KEY }} | |
run: | | |
for i in {1..3}; do | |
echo "Integration test attempt $i/3..." | |
if yarn jest tests/custom --testTimeout=300000; then | |
echo "Integration tests passed on attempt $i" | |
break | |
elif [ $i -eq 3 ]; then | |
echo "Integration tests failed after 3 attempts" | |
exit 1 | |
else | |
echo "Integration tests failed on attempt $i, retrying in 30 seconds..." | |
sleep 30 | |
fi | |
done | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Set up node | |
uses: actions/setup-node@v3 | |
- name: Install dependencies and fix TypeScript compatibility | |
run: | | |
yarn install | |
echo 'Adding resolutions to package.json...' | |
node -e " | |
const fs = require('fs'); | |
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); | |
pkg.resolutions = { '@types/babel__traverse': '7.20.6' }; | |
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2)); | |
" | |
yarn install --force | |
- name: Integration Server Test | |
env: | |
VOYAGE_API_KEY: ${{ secrets.VOYAGE_API_KEY }} | |
run: yarn jest --coverage tests/unit tests/integration tests/custom --testTimeout=300000 | |
publish: | |
needs: [compile, unit-test, integration-test] | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') && ! contains(github.ref, '0.0.0') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Set up node | |
uses: actions/setup-node@v3 | |
- name: Install dependencies and fix TypeScript compatibility | |
run: | | |
yarn install | |
echo 'Adding resolutions to package.json...' | |
node -e " | |
const fs = require('fs'); | |
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); | |
pkg.resolutions = { '@types/babel__traverse': '7.20.6' }; | |
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2)); | |
" | |
yarn install --force | |
- name: Build | |
run: yarn build | |
- name: Publish to npm | |
run: | | |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN} | |
npm publish --access public | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
delete-tag-if-code-generation-only: | |
needs: [compile, unit-test, integration-test] | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') && contains(github.ref, '0.0.0') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: ClementTsang/[email protected] | |
with: | |
delete_release: true | |
tag_name: 0.0.0 # tag name to delete | |
env: | |
GITHUB_TOKEN: ${{ secrets.TAGGING_GITHUB_TOKEN }} |