CI Flow #7
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
name: Validate and run tests | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
workflow_dispatch: {} | |
workflow_call: | |
secrets: | |
PINECONE_API_KEY: | |
required: true | |
PINECONE_ENVIRONMENT: | |
required: true | |
jobs: | |
basic-hygiene: | |
name: Linting, formatting, etc | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup | |
uses: ./.github/actions/setup | |
- name: Prettier | |
run: npm run format | |
- name: Check for prettier changes | |
run: | | |
git diff --exit-code >/dev/null 2>&1 | |
EXIT_CODE=$? | |
if [ $EXIT_CODE -ne 0 ]; then | |
echo "Prettier changes detected. Please run 'npm run format' and commit the changes." | |
exit 1 | |
fi | |
- name: ESLint | |
run: npm run lint | |
run-integration-tests: | |
name: Integration tests | |
runs-on: macos-latest | |
permissions: | |
# Required to checkout the code | |
contents: read | |
# Required to put a comment into the pull-request | |
pull-requests: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup | |
uses: ./.github/actions/setup | |
- name: Run integration tests | |
uses: ./.github/actions/integrationTests | |
with: | |
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} | |
PINECONE_ENVIRONMENT: ${{ secrets.PINECONE_ENVIRONMENT }} |