Unverified Commit 8043cb19 authored by Lintang Sutawika's avatar Lintang Sutawika Committed by GitHub
Browse files

Merge pull request #871 from EleutherAI/deactivate-ci-tests

[Refactor] Deactivate select GH Actions
parents d7ddf525 a019eeae
name: Tasks Modified # name: Tasks Modified
on: # on:
push: # push:
branches: # branches:
- 'big-refactor*' # - 'big-refactor*'
pull_request: # pull_request:
branches: # branches:
- 'big-refactor*' # - 'big-refactor*'
workflow_dispatch: # workflow_dispatch:
# comment/edit out the above to stop/change the triggers # # comment/edit out the above to stop/change the triggers
jobs: # jobs:
changed_files: # changed_files:
runs-on: ubuntu-latest # windows-latest || macos-latest # runs-on: ubuntu-latest # windows-latest || macos-latest
timeout-minutes: 120 # timeout-minutes: 120
name: Scan for changed tasks # name: Scan for changed tasks
steps: # steps:
- name: checkout # - name: checkout
uses: actions/checkout@v3 # uses: actions/checkout@v3
with: # with:
fetch-depth: 2 # OR "2" -> To retrieve the preceding commit. # fetch-depth: 2 # OR "2" -> To retrieve the preceding commit.
# Uses the tj-actions/changed-files@v37 action to check for changes. # # Uses the tj-actions/changed-files@v37 action to check for changes.
# Outputs provided here: https://github.com/tj-actions/changed-files#outputs # # Outputs provided here: https://github.com/tj-actions/changed-files#outputs
# The `files_yaml` input optionally takes a yaml string to specify filters, # # The `files_yaml` input optionally takes a yaml string to specify filters,
# and prepends the filter name to the standard output names. # # and prepends the filter name to the standard output names.
- name: Check task folders # - name: Check task folders
id: changed-tasks # id: changed-tasks
uses: tj-actions/changed-files@v37.1.2 # uses: tj-actions/changed-files@v37.1.2
with: # with:
# tasks checks the tasks folder and api checks the api folder for changes # # tasks checks the tasks folder and api checks the api folder for changes
files_yaml: | # files_yaml: |
tasks: # tasks:
- lm_eval/tasks/** # - lm_eval/tasks/**
api: # api:
- lm_eval/api/** # - lm_eval/api/**
write_output_files: true # write_output_files: true
# The next step is optional; the files are written to the workspace by default (above). # # The next step is optional; the files are written to the workspace by default (above).
# so it's just for debugging # # so it's just for debugging
- name: Run Tests # - name: Run Tests
if: steps.changed-tasks.outputs.tasks_any_modified == 'true' || steps.changed-tasks.outputs.api_any_modified == 'true' # if: steps.changed-tasks.outputs.tasks_any_modified == 'true' || steps.changed-tasks.outputs.api_any_modified == 'true'
run: | # run: |
echo .github/outputs/tasks_all_changed_and_modified_files.txt >> 'GITHUB_ENV' # echo .github/outputs/tasks_all_changed_and_modified_files.txt >> 'GITHUB_ENV'
echo "One or more test file(s) has changed." # 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 }}" # echo "List of all the files that have changed: ${{ steps.changed-tasks.outputs.tasks_all_modified_files }}"
- name: Set up Python 3.9 # - name: Set up Python 3.9
if: steps.changed-tasks.outputs.tasks_any_modified == 'true' || steps.changed-tasks.outputs.api_any_modified == 'true' # if: steps.changed-tasks.outputs.tasks_any_modified == 'true' || steps.changed-tasks.outputs.api_any_modified == 'true'
uses: actions/setup-python@v4 # uses: actions/setup-python@v4
with: # with:
python-version: 3.9 # python-version: 3.9
cache: 'pip' # cache: 'pip'
cache-dependency-path: setup.py # cache-dependency-path: setup.py
- name: Install dependencies # - name: Install dependencies
if: steps.changed-tasks.outputs.tasks_any_modified == 'true' || steps.changed-tasks.outputs.api_any_modified == 'true' # if: steps.changed-tasks.outputs.tasks_any_modified == 'true' || steps.changed-tasks.outputs.api_any_modified == 'true'
run: | # run: |
python -m pip install --upgrade pip # python -m pip install --upgrade pip
pip install -e '.[testing]' --extra-index-url https://download.pytorch.org/whl/cpu # pip install -e '.[testing]' --extra-index-url https://download.pytorch.org/whl/cpu
# Install optional git dependencies # # Install optional git dependencies
# pip install bleurt@https://github.com/google-research/bleurt/archive/b610120347ef22b494b6d69b4316e303f5932516.zip#egg=bleurt # # 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 # # if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest # - name: Test with pytest
# if new tasks are added, run tests on them # # if new tasks are added, run tests on them
if: steps.changed-tasks.outputs.tasks_any_modified == 'true' # if: steps.changed-tasks.outputs.tasks_any_modified == 'true'
run: python -m pytest tests/test_tasks.py -s -vv # run: python -m pytest tests/test_tasks.py -s -vv
# if api is modified, run tests on it # # if api is modified, run tests on it
- name: Test more tasks with pytest # - name: Test more tasks with pytest
env: # env:
API: true # API: true
if: steps.changed-tasks.outputs.api_any_modified == 'true' # if: steps.changed-tasks.outputs.api_any_modified == 'true'
run: python -m pytest tests/test_tasks.py -s -vv # run: python -m pytest tests/test_tasks.py -s -vv
...@@ -44,35 +44,35 @@ jobs: ...@@ -44,35 +44,35 @@ jobs:
# - name: Lint with mypy # - name: Lint with mypy
# run: mypy . --ignore-missing-imports --check-untyped-defs --explicit-package-bases --warn-unreachable # run: mypy . --ignore-missing-imports --check-untyped-defs --explicit-package-bases --warn-unreachable
# Job 2 # Job 2
testcpu: # testcpu:
name: CPU Tests # name: CPU Tests
runs-on: ubuntu-latest # runs-on: ubuntu-latest
strategy: # strategy:
matrix: # matrix:
python-version: [ "3.9", "3.10", "3.11" ] # python-version: [ "3.9", "3.10", "3.11" ]
timeout-minutes: 30 # timeout-minutes: 30
steps: # steps:
- name: Checkout Code # - name: Checkout Code
uses: actions/checkout@v3 # uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }} # - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4 # uses: actions/setup-python@v4
with: # with:
python-version: ${{ matrix.python-version }} # python-version: ${{ matrix.python-version }}
cache: pip # cache: pip
cache-dependency-path: setup.py # cache-dependency-path: setup.py
- name: Install dependencies # - name: Install dependencies
run: | # run: |
python -m pip install --upgrade pip # python -m pip install --upgrade pip
pip install -e '.[testing,anthropic,sentencepiece]' --extra-index-url https://download.pytorch.org/whl/cpu # pip install -e '.[testing,anthropic,sentencepiece]' --extra-index-url https://download.pytorch.org/whl/cpu
# Install optional git dependencies # # Install optional git dependencies
# pip install bleurt@https://github.com/google-research/bleurt/archive/b610120347ef22b494b6d69b4316e303f5932516.zip#egg=bleurt # # 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 # # if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest # - name: Test with pytest
run: python -m pytest --showlocals -s -vv -n=auto --ignore=tests/tests_master --ignore=tests/extra # run: python -m pytest --showlocals -s -vv -n=auto --ignore=tests/tests_master --ignore=tests/extra
- name: Archive artifacts # - name: Archive artifacts
uses: actions/upload-artifact@v3 # uses: actions/upload-artifact@v3
with: # with:
name: output_results # name: output_results
path: | # path: |
test_logs/* # test_logs/*
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment