Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
lm-evaluation-harness
Commits
436b2697
Commit
436b2697
authored
Oct 04, 2023
by
haileyschoelkopf
Browse files
also, reenable CPU tests
parent
9b06de54
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
100 additions
and
100 deletions
+100
-100
.github/workflows/new_tasks.yml
.github/workflows/new_tasks.yml
+68
-68
.github/workflows/unit_tests.yml
.github/workflows/unit_tests.yml
+32
-32
No files found.
.github/workflows/new_tasks.yml
View file @
436b2697
#
name: Tasks Modified
name
:
Tasks Modified
#
on:
#
push:
#
branches:
#
- 'big-refactor*'
#
pull_request:
#
branches:
#
- 'big-refactor*'
#
workflow_dispatch:
#
# comment/edit out the above to stop/change the triggers
#
jobs:
#
changed_files:
#
runs-on: ubuntu-latest # windows-latest || macos-latest
#
timeout-minutes: 120
#
name: Scan for changed tasks
#
steps:
#
- name: checkout
#
uses: actions/checkout@v3
#
with:
#
fetch-depth: 2 # OR "2" -> To retrieve the preceding commit.
on
:
push
:
branches
:
-
'
big-refactor*'
pull_request
:
branches
:
-
'
big-refactor*'
workflow_dispatch
:
# comment/edit out the above to stop/change the triggers
jobs
:
changed_files
:
runs-on
:
ubuntu-latest
# windows-latest || macos-latest
timeout-minutes
:
120
name
:
Scan for changed tasks
steps
:
-
name
:
checkout
uses
:
actions/checkout@v3
with
:
fetch-depth
:
2
# OR "2" -> To retrieve the preceding commit.
#
# Uses the tj-actions/changed-files@v37 action to check for changes.
#
# Outputs provided here: https://github.com/tj-actions/changed-files#outputs
#
# The `files_yaml` input optionally takes a yaml string to specify filters,
#
# and prepends the filter name to the standard output names.
#
- name: Check task folders
#
id: changed-tasks
#
uses: tj-actions/changed-files@v37.1.2
#
with:
#
# tasks checks the tasks folder and api checks the api folder for changes
#
files_yaml: |
#
tasks:
#
- lm_eval/tasks/**
#
api:
#
- lm_eval/api/**
#
write_output_files: true
# Uses the tj-actions/changed-files@v37 action to check for changes.
# Outputs provided here: https://github.com/tj-actions/changed-files#outputs
# The `files_yaml` input optionally takes a yaml string to specify filters,
# and prepends the filter name to the standard output names.
-
name
:
Check task folders
id
:
changed-tasks
uses
:
tj-actions/changed-files@v37.1.2
with
:
# tasks checks the tasks folder and api checks the api folder for changes
files_yaml
:
|
tasks:
- lm_eval/tasks/**
api:
- lm_eval/api/**
write_output_files
:
true
#
# The next step is optional; the files are written to the workspace by default (above).
#
# so it's just for debugging
#
- name: Run Tests
#
if: steps.changed-tasks.outputs.tasks_any_modified == 'true' || steps.changed-tasks.outputs.api_any_modified == 'true'
#
run: |
#
echo .github/outputs/tasks_all_changed_and_modified_files.txt >> 'GITHUB_ENV'
#
echo "One or more test file(s) has changed."
#
echo "List of all the files that have changed: ${{ steps.changed-tasks.outputs.tasks_all_modified_files }}"
# The next step is optional; the files are written to the workspace by default (above).
# so it's just for debugging
-
name
:
Run Tests
if
:
steps.changed-tasks.outputs.tasks_any_modified == 'true' || steps.changed-tasks.outputs.api_any_modified == 'true'
run
:
|
echo .github/outputs/tasks_all_changed_and_modified_files.txt >> 'GITHUB_ENV'
echo "One or more test file(s) has changed."
echo "List of all the files that have changed: ${{ steps.changed-tasks.outputs.tasks_all_modified_files }}"
#
- name: Set up Python 3.9
#
if: steps.changed-tasks.outputs.tasks_any_modified == 'true' || steps.changed-tasks.outputs.api_any_modified == 'true'
#
uses: actions/setup-python@v4
#
with:
#
python-version: 3.9
#
cache: 'pip'
#
cache-dependency-path: setup.py
#
- name: Install dependencies
#
if: steps.changed-tasks.outputs.tasks_any_modified == 'true' || steps.changed-tasks.outputs.api_any_modified == 'true'
#
run: |
#
python -m pip install --upgrade pip
#
pip install -e '.[testing]' --extra-index-url https://download.pytorch.org/whl/cpu
#
# Install optional git dependencies
#
# pip install bleurt@https://github.com/google-research/bleurt/archive/b610120347ef22b494b6d69b4316e303f5932516.zip#egg=bleurt
#
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
#
- name: Test with pytest
#
# if new tasks are added, run tests on them
#
if: steps.changed-tasks.outputs.tasks_any_modified == 'true'
#
run: python -m pytest tests/test_tasks.py -s -vv
#
# if api is modified, run tests on it
#
- name: Test more tasks with pytest
#
env:
#
API: true
#
if: steps.changed-tasks.outputs.api_any_modified == 'true'
#
run: python -m pytest tests/test_tasks.py -s -vv
-
name
:
Set up Python
3.9
if
:
steps.changed-tasks.outputs.tasks_any_modified == 'true' || steps.changed-tasks.outputs.api_any_modified == 'true'
uses
:
actions/setup-python@v4
with
:
python-version
:
3.9
cache
:
'
pip'
cache-dependency-path
:
setup.py
-
name
:
Install dependencies
if
:
steps.changed-tasks.outputs.tasks_any_modified == 'true' || steps.changed-tasks.outputs.api_any_modified == 'true'
run
:
|
python -m pip install --upgrade pip
pip install -e '.[testing]' --extra-index-url https://download.pytorch.org/whl/cpu
# Install optional git dependencies
# pip install bleurt@https://github.com/google-research/bleurt/archive/b610120347ef22b494b6d69b4316e303f5932516.zip#egg=bleurt
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
-
name
:
Test with pytest
# if new tasks are added, run tests on them
if
:
steps.changed-tasks.outputs.tasks_any_modified == 'true'
run
:
python -m pytest tests/test_tasks.py -s -vv
# if api is modified, run tests on it
-
name
:
Test more tasks with pytest
env
:
API
:
true
if
:
steps.changed-tasks.outputs.api_any_modified == 'true'
run
:
python -m pytest tests/test_tasks.py -s -vv
.github/workflows/unit_tests.yml
View file @
436b2697
...
...
@@ -43,35 +43,35 @@ jobs:
# # mypy turned off for now
# - name: Lint with mypy
# run: mypy . --ignore-missing-imports --check-untyped-defs --explicit-package-bases --warn-unreachable
#
Job 2
#
testcpu:
#
name: CPU Tests
#
runs-on: ubuntu-latest
#
strategy:
#
matrix:
#
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
#
timeout-minutes: 30
#
steps:
#
- name: Checkout Code
#
uses: actions/checkout@v3
#
- name: Set up Python ${{ matrix.python-version }}
#
uses: actions/setup-python@v4
#
with:
#
python-version: ${{ matrix.python-version }}
#
cache: pip
#
cache-dependency-path: setup.py
#
- name: Install dependencies
#
run: |
#
python -m pip install --upgrade pip
#
pip install -e '.[testing,anthropic,sentencepiece]' --extra-index-url https://download.pytorch.org/whl/cpu
#
# Install optional git dependencies
#
# pip install bleurt@https://github.com/google-research/bleurt/archive/b610120347ef22b494b6d69b4316e303f5932516.zip#egg=bleurt
#
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
#
- name: Test with pytest
#
run: python -m pytest --showlocals -s -vv -n=auto --ignore=tests/tests_master --ignore=tests/extra
#
- name: Archive artifacts
#
uses: actions/upload-artifact@v3
#
with:
#
name: output_results
#
path: |
#
test_logs/*
Job
2
testcpu
:
name
:
CPU Tests
runs-on
:
ubuntu-latest
strategy
:
matrix
:
python-version
:
[
"
3.8"
,
"
3.9"
,
"
3.10"
,
"
3.11"
]
timeout-minutes
:
30
steps
:
-
name
:
Checkout Code
uses
:
actions/checkout@v3
-
name
:
Set up Python ${{ matrix.python-version }}
uses
:
actions/setup-python@v4
with
:
python-version
:
${{ matrix.python-version }}
cache
:
pip
cache-dependency-path
:
setup.py
-
name
:
Install dependencies
run
:
|
python -m pip install --upgrade pip
pip install -e '.[testing,anthropic,sentencepiece]' --extra-index-url https://download.pytorch.org/whl/cpu
# Install optional git dependencies
# pip install bleurt@https://github.com/google-research/bleurt/archive/b610120347ef22b494b6d69b4316e303f5932516.zip#egg=bleurt
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
-
name
:
Test with pytest
run
:
python -m pytest --showlocals -s -vv -n=auto --ignore=tests/tests_master --ignore=tests/extra
-
name
:
Archive artifacts
uses
:
actions/upload-artifact@v3
with
:
name
:
output_results
path
:
|
test_logs/*
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment