Update pre-commit to prek #2
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: Run Target Tests | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| paths-ignore: | |
| - '.github/workflows/**' | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| workflow_dispatch: | |
| inputs: | |
| log_level: | |
| description: 'Log level' | |
| required: false | |
| default: 'warning' | |
| environment: | |
| description: 'Environment to run tests in' | |
| required: false | |
| default: 'staging' | |
| jobs: | |
| target_tests: | |
| if: github.event_name == 'pull_request' || github.event.pull_request == null | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: 'recursive' | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Checkout submodules | |
| run: | | |
| git submodule init | |
| git submodule update | |
| - name: Read Python version | |
| run: echo "PYTHON_VERSION=$(cat .python-version | tr -d '\n')" >> $GITHUB_ENV | |
| - run: | | |
| echo "Log Level: ${{ github.event.inputs.log_level }}" | |
| echo "Environment: ${{ github.event.inputs.environment }}" | |
| - name: Set up Python | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install Rye | |
| uses: eifinger/setup-rye@v4 | |
| with: | |
| version: 'latest' | |
| - name: Install dependencies | |
| run: | | |
| rye sync | |
| - name: Set environment variables | |
| run: | | |
| echo "DEV_ENV=${{ secrets.DEV_ENV }}" >> $GITHUB_ENV | |
| echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> $GITHUB_ENV | |
| echo "ANTHROPIC_API_KEY=${{ secrets.ANTHROPIC_API_KEY }}" >> $GITHUB_ENV | |
| echo "GROQ_API_KEY=${{ secrets.GROQ_API_KEY }}" >> $GITHUB_ENV | |
| echo "PERPLEXITY_API_KEY=${{ secrets.PERPLEXITY_API_KEY }}" >> $GITHUB_ENV | |
| echo "GEMINI_API_KEY=${{ secrets.GEMINI_API_KEY }}" >> $GITHUB_ENV | |
| - name: Run tests | |
| run: | | |
| make test |