Use HUGGING_FACE_HUB_TOKEN #27
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: Tests | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
permissions: | |
contents: read | |
issues: read | |
checks: write | |
pull-requests: write | |
jobs: | |
lint: | |
if: "!contains(github.event.head_commit.message, '[skip]')" | |
runs-on: ubuntu-latest | |
concurrency: | |
group: lint-${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
- name: Cache .venv_dev/dev | |
id: cache-venv-dev-dev | |
uses: actions/cache@v3 | |
with: | |
path: .venv_dev/dev | |
key: lint-venv-dev-dev-${{ runner.os }}-${{ hashFiles('src/requirements-dev.txt') }} | |
- name: Lint | |
run: sudo -H -E ./lint.sh | |
test: | |
if: "!contains(github.event.head_commit.message, '[skip]')" | |
runs-on: ubuntu-latest | |
concurrency: | |
group: test-${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
- name: Cache PROJECT_DATA | |
id: cache-project-data | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/project_data | |
key: test-project-data-${{ runner.os }}-${{ hashFiles('.cluster/**/*.sh') }} | |
- name: Cache .venv/prod | |
id: cache-venv-prod | |
uses: actions/cache@v3 | |
with: | |
path: .venv/prod | |
key: test-venv-prod-${{ runner.os }}-${{ hashFiles('src/requirements-dev.txt', 'src/requirements-test.txt', 'src/requirements.txt', 'src/requirements-cpu.txt', 'src/requirements-accelerator-device.txt') }} | |
- name: Run tests | |
run: sudo -H -E env "PATH=$PATH" ./run.sh -vvvv --durations=0 --junitxml=./test.xml --maxfail=2 | |
env: | |
PROJECT_DATA: /tmp/project_data | |
PROJECT_DISABLE_TUNNEL: 1 | |
PROJECT_JOB_NAME: "test" # This makes run.sh run with `pytest` instead of `python3` | |
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
- name: Publish Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
id: test-results | |
if: always() | |
with: | |
files: "test.xml" | |
check_name: "Test Results" | |
comment_title: "Test Results" | |
comment_mode: "off" | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |