-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #780 from StanfordVL/torch
NumPy -> Torch
- Loading branch information
Showing
178 changed files
with
4,475 additions
and
3,286 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,132 @@ | ||
name: Examples as Test | ||
name: Examples as Tests | ||
|
||
on: | ||
schedule: | ||
# * is a special character in YAML so you have to quote this string | ||
# Format: minute hour day-of-month month day-of-week(starts on sunday) | ||
# Scheduled for 2 am, every sunday, tuesday, friday | ||
- cron: '0 10 * * 0,2,5' | ||
# Scheduled for 2 am, everyday | ||
- cron: '0 10 * * *' | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
runs-on: [self-hosted, linux, gpu] | ||
if: github.repository == 'StanfordVL/OmniGibson-dev' | ||
|
||
generate_example_tests: | ||
name: Generate Example Tests | ||
runs-on: [self-hosted, linux, gpu, dataset-enabled] | ||
defaults: | ||
run: | ||
shell: micromamba run -n omnigibson /bin/bash -leo pipefail {0} | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
path: omnigibson | ||
|
||
- name: Add CUDA to env | ||
run: echo "/usr/local/cuda/bin" >> $GITHUB_PATH | ||
|
||
- name: Setup python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.8" | ||
architecture: x64 | ||
|
||
path: omnigibson-src | ||
|
||
- name: Install dev requirements | ||
working-directory: omnigibson | ||
working-directory: omnigibson-src | ||
run: pip install -r requirements-dev.txt | ||
|
||
- name: Install additional dev requirements | ||
working-directory: omnigibson | ||
run: pip install -r tests/requirements-tests.txt | ||
|
||
|
||
- name: Install | ||
working-directory: omnigibson | ||
working-directory: omnigibson-src | ||
run: pip install -e . | ||
|
||
- name: Uninstall pip bddl | ||
working-directory: omnigibson | ||
run: pip uninstall -y bddl | ||
- name: Generate example tests | ||
working-directory: omnigibson-src | ||
run: python tests/create_tests_of_examples.py | ||
|
||
- name: Get list of generated tests | ||
id: get-test-list | ||
working-directory: omnigibson-src | ||
run: | | ||
echo "example_tests=$(cat tests/example_tests.json)" >> $GITHUB_OUTPUT | ||
outputs: | ||
example_tests: ${{ steps.get-test-list.outputs.example_tests }} | ||
|
||
run_test: | ||
name: Run Example Tests | ||
needs: [generate_example_tests] | ||
runs-on: [self-hosted, linux, gpu, dataset-enabled] | ||
|
||
strategy: | ||
matrix: | ||
test_file: | ||
- ${{ needs.generate_example_tests.outputs.example_tests != '' && fromJson(needs.generate_example_tests.outputs.example_tests) }} | ||
fail-fast: true | ||
|
||
defaults: | ||
run: | ||
shell: micromamba run -n omnigibson /bin/bash -leo pipefail {0} | ||
|
||
steps: | ||
- name: Check for generated tests | ||
if: ${{ needs.generate_example_tests.outputs.example_tests == '' }} | ||
run: | | ||
echo "No tests were generated. Failing the job." | ||
exit 1 | ||
- name: Checkout BDDL | ||
- name: Fix home | ||
run: echo "HOME=/root" >> $GITHUB_ENV | ||
|
||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: StanfordVL/bddl-dev | ||
ref: 581be50e7cfd2b3a1447aaa1b4fc2424b673339c | ||
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} # PAT is required since this is a different repo | ||
path: bddl | ||
submodules: recursive | ||
lfs: true | ||
|
||
- name: Install BDDL | ||
working-directory: bddl | ||
run: pip install -e . | ||
submodules: true | ||
path: omnigibson-src | ||
|
||
- name: Link Dataset | ||
working-directory: omnigibson | ||
run: ln -s /scr/ig-data omnigibson/data | ||
- name: Install dev requirements | ||
working-directory: omnigibson-src | ||
run: pip install -r requirements-dev.txt | ||
|
||
- name: Create tests of examples | ||
working-directory: omnigibson | ||
run: python tests/create_tests_of_examples.py | ||
- name: Install | ||
working-directory: omnigibson-src | ||
run: pip install -e . | ||
|
||
- name: Run tests | ||
working-directory: omnigibson | ||
run: pytest /tmp/tests_of_examples | ||
working-directory: omnigibson-src | ||
run: pytest -s tests/tests_of_examples/${{ matrix.test_file }}.py --junitxml=${{ matrix.test_file }}.xml && cp ${{ matrix.test_file }}.xml ${GITHUB_WORKSPACE}/ | ||
|
||
- name: Remove Files | ||
uses: JesseTG/[email protected] | ||
- name: Deploy artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ github.run_id }}-tests-${{ matrix.test_file }} | ||
path: ${{ matrix.test_file }}.xml | ||
|
||
- name: Fail on failure or error | ||
run: grep -Eq "<failure|error" ${{ matrix.test_file }}.xml; if [ $? -eq 0 ]; then exit 1; else exit 0; fi | ||
|
||
upload_report: | ||
name: Compile Example Test Report | ||
runs-on: [self-hosted, linux] | ||
defaults: | ||
run: | ||
shell: micromamba run -n omnigibson /bin/bash -leo pipefail {0} | ||
needs: [run_test] | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
path: omnigibson-src | ||
- name: Pull reports | ||
uses: actions/download-artifact@v3 | ||
with: | ||
path: omnigibson-src | ||
- name: Example Test Report0 | ||
uses: dorny/test-reporter@v1 | ||
with: | ||
path: /tmp/tests_of_examples | ||
name: Example Test Results | ||
working-directory: omnigibson-src | ||
path: ${{ github.run_id }}-tests-*/*_test.xml | ||
reporter: java-junit | ||
fail-on-error: 'true' | ||
fail-on-empty: 'true' | ||
|
||
# - name: Upload coverage to Codecov | ||
# uses: codecov/[email protected] | ||
# with: | ||
# token: ${{ secrets.CODECOV_TOKEN }} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,4 +87,7 @@ coverage.xml | |
|
||
# Doc | ||
docs/reference | ||
site/ | ||
site/ | ||
|
||
# Tests of examples | ||
tests/tests_of_examples |
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
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
Oops, something went wrong.