From b21b933ce5b25154b9eae8a98b67672a35d4969a Mon Sep 17 00:00:00 2001 From: "Jessica Zhang (NY)" Date: Tue, 22 Oct 2024 15:18:08 -0400 Subject: [PATCH] Fix trigger and variables --- .../action.yml | 11 --- .github/actions/linux/action.yml | 3 +- .github/actions/macos/action.yml | 12 ++- .github/actions/windows/action.yml | 16 ++++ .github/workflows/core_tests.yml | 72 +++----------- .github/workflows/plugin_tests.yml | 95 ------------------- 6 files changed, 38 insertions(+), 171 deletions(-) delete mode 100644 .github/actions/early_return_for_forked_pull_requests/action.yml create mode 100644 .github/actions/windows/action.yml delete mode 100644 .github/workflows/plugin_tests.yml diff --git a/.github/actions/early_return_for_forked_pull_requests/action.yml b/.github/actions/early_return_for_forked_pull_requests/action.yml deleted file mode 100644 index 341ff2ee31..0000000000 --- a/.github/actions/early_return_for_forked_pull_requests/action.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: early_return_for_forked_pull_requests -runs: - using: composite - steps: - - name: Early return if this build is from a forked PR - run: |- - if [ -n "${{ github.event.number }}" ]; then - echo "Nothing to do for forked PRs, so marking this step successful" - circleci step halt - fi - shell: bash \ No newline at end of file diff --git a/.github/actions/linux/action.yml b/.github/actions/linux/action.yml index 26defdbdd6..e22b3a35d8 100644 --- a/.github/actions/linux/action.yml +++ b/.github/actions/linux/action.yml @@ -5,7 +5,6 @@ inputs: runs: using: composite steps: - - uses: actions/checkout@v4.1.0 - name: Preparing environment - Conda run: |- curl -o Miniconda3-py38_4.8.3-Linux-x86_64.sh https://repo.anaconda.com/miniconda/Miniconda3-py38_4.8.3-Linux-x86_64.sh @@ -20,4 +19,4 @@ runs: run: |- ~/miniconda3/bin/conda init bash ~/miniconda3/bin/conda create -n hydra python=${{ inputs.py_version }} -yqc conda-forge - shell: bash \ No newline at end of file + shell: bash diff --git a/.github/actions/macos/action.yml b/.github/actions/macos/action.yml index cdbea00a9b..44690c4c63 100644 --- a/.github/actions/macos/action.yml +++ b/.github/actions/macos/action.yml @@ -5,12 +5,16 @@ inputs: runs: using: composite steps: - - uses: actions/checkout@v4.1.0 - name: restore_cache uses: actions/cache@v3.3.2 with: key: "-${{ inputs.cache_key_version }}-macos-sys-{{ .Branch }}-${{ inputs.py_version }}" - path: UPDATE_ME + path: |- + ~/miniconda3 + ~/Library/Caches/Homebrew + - uses: maxim-lobanov/setup-xcode@v1.6.0 + with: + xcode-version: latest-stable - name: Preparing environment - Conda run: |- if [[ -f ~/miniconda3/LICENSE.txt ]] ; then @@ -31,6 +35,8 @@ runs: shell: bash - name: Preparing environment - Hydra run: |- + source $HOME/.bash_profile + echo $PATH conda create -n hydra python=${{ inputs.py_version }} -yqc conda-forge conda run -n hydra pip install nox --progress-bar off shell: bash @@ -40,4 +46,4 @@ runs: path: |- ~/miniconda3 ~/Library/Caches/Homebrew - key: "-${{ inputs.cache_key_version }}-macos-sys-{{ .Branch }}-${{ inputs.py_version }}" \ No newline at end of file + key: "-${{ inputs.cache_key_version }}-macos-sys-{{ .Branch }}-${{ inputs.py_version }}" diff --git a/.github/actions/windows/action.yml b/.github/actions/windows/action.yml new file mode 100644 index 0000000000..091d8c664d --- /dev/null +++ b/.github/actions/windows/action.yml @@ -0,0 +1,16 @@ +name: windows +inputs: + py_version: + required: true +runs: + using: composite + steps: + - uses: conda-incubator/setup-miniconda@v3 + with: + miniconda-version: "latest" + python-version: ${{ inputs.py_version }} + activate-environment: hydra + - uses: actions/setup-java@v4 + with: + distribution: 'microsoft' + java-version: '21' diff --git a/.github/workflows/core_tests.yml b/.github/workflows/core_tests.yml index ab2bc9b5af..b97f5a88be 100644 --- a/.github/workflows/core_tests.yml +++ b/.github/workflows/core_tests.yml @@ -1,35 +1,8 @@ name: facebookresearch/hydra/core_tests on: - workflow_dispatch: - inputs: - plugin_test: - required: true - test_plugins: - required: true - cache_key_version: - required: false - default: v1 -env: - AWS_ACCESS_KEY_ID: xxxxXT3Z - AWS_DEFAULT_REGION: xxxxst-2 - AWS_SECRET_ACCESS_KEY: xxxxGsxB - CIRCLECI_TOKEN: xxxxed79 - INSTANCE_ROLE_ARN: xxxxr-v1 + push jobs: - trigger_plugin_pipelines: - if: ${{ !(${{ inputs.plugin_test }}) }} - runs-on: ubuntu-latest - container: - image: python:3.8 - steps: - - uses: "./.github/actions/early_return_for_forked_pull_requests" - - uses: actions/checkout@v4.1.0 - - name: Kick off Plugin tests - run: |- - python tools/ci/circleci_pipeline.py - echo "Done kicking off plugin tests." test_macos: - if: ${{ !(${{ inputs.plugin_test }}) }} runs-on: macos-latest strategy: matrix: @@ -40,28 +13,19 @@ jobs: - '3.11' steps: - uses: actions/checkout@v4.1.0 - - uses: maxim-lobanov/setup-xcode@v1.6.0 - with: - xcode-version: 13.4.1 - uses: "./.github/actions/macos" with: py_version: "${{ matrix.py_version }}" - name: Testing Hydra run: |- + source $HOME/.bash_profile export NOX_PYTHON_VERSIONS=${{ matrix.py_version }} conda activate hydra pip install nox dataclasses --progress-bar off - if [ -n "${{ github.event.number }}" ]; then nox -s lint test_tools test_core \ test_jupyter_notebooks lint_plugins test_plugins test_plugins_vs_core -ts - else - nox -s lint test_tools test_core test_jupyter_notebooks -ts - fi test_linux: - if: ${{ !(${{ inputs.plugin_test }}) }} runs-on: ubuntu-latest - container: - image: ubuntu strategy: matrix: py_version: @@ -79,15 +43,10 @@ jobs: export PATH="$HOME/miniconda3/envs/hydra/bin:$PATH" export NOX_PYTHON_VERSIONS=${{ matrix.py_version }} pip install nox dataclasses --progress-bar off - if [ -n "${{ github.event.number }}" ]; then - nox -s lint test_tools test_core \ - test_jupyter_notebooks lint_plugins test_plugins test_plugins_vs_core -ts - else - nox -s lint test_tools test_core test_jupyter_notebooks -ts - fi + nox -s lint test_tools test_core \ + test_jupyter_notebooks lint_plugins test_plugins test_plugins_vs_core -ts test_win: - if: ${{ !(${{ inputs.plugin_test }}) }} - runs-on: ubuntu-latest + runs-on: windows-latest strategy: matrix: py_version: @@ -96,25 +55,18 @@ jobs: - '3.10' - '3.11' steps: -# # This item has no matching transformer -# - circleci_windows_: + - uses: actions/checkout@v4.1.0 + - uses: "./.github/actions/windows" - name: Testing Hydra run: |- - $env:NOX_PYTHON_VERSIONS="${{ matrix.py_version }}" - $env:ConEmuDefaultCp=65001 - $env:PYTHONIOENCODING="utf_8" - conda activate hydra - If ($env:${{ github.event.number }}) { - nox -s lint test_tools test_core test_jupyter_notebooks lint_plugins test_plugins test_plugins_vs_core -ts - } else { - nox -s lint test_tools test_core test_jupyter_notebooks -ts - } + conda run -n hydra pip install nox --progress-bar off + set NOX_PYTHON_VERSIONS="${{ matrix.py_version }}" + set ConEmuDefaultCp=65001 + set PYTHONIOENCODING="utf_8" + nox -s lint test_tools test_core test_jupyter_notebooks lint_plugins test_plugins test_plugins_vs_core -ts exit $LASTEXITCODE test_linux_omc_dev: - if: ${{ !(${{ inputs.plugin_test }}) }} runs-on: ubuntu-latest - container: - image: ubuntu strategy: matrix: py_version: diff --git a/.github/workflows/plugin_tests.yml b/.github/workflows/plugin_tests.yml deleted file mode 100644 index 1ae6461327..0000000000 --- a/.github/workflows/plugin_tests.yml +++ /dev/null @@ -1,95 +0,0 @@ -name: facebookresearch/hydra/plugin_tests -on: - workflow_dispatch: - inputs: - plugin_test: - required: true - test_plugins: - required: true - cache_key_version: - required: false - default: v1 -env: - AWS_ACCESS_KEY_ID: xxxxXT3Z - AWS_DEFAULT_REGION: xxxxst-2 - AWS_SECRET_ACCESS_KEY: xxxxGsxB - CIRCLECI_TOKEN: xxxxed79 - INSTANCE_ROLE_ARN: xxxxr-v1 -jobs: - test_plugin_linux: - if: ${{ inputs.plugin_test }} - runs-on: ubuntu-latest - container: - image: ubuntu - strategy: - matrix: - py_version: - - '3.8' - - '3.9' - - '3.10' - - '3.11' - test_plugin: - - "${{ inputs.test_plugins }}" - steps: - - uses: actions/checkout@v4.1.0 - - uses: "./.github/actions/linux" - with: - py_version: "${{ matrix.py_version }}" - - name: "${{ matrix.test_plugin }}" - run: |- - export PATH="$HOME/miniconda3/envs/hydra/bin:$PATH" - export NOX_PYTHON_VERSIONS=${{ matrix.py_version }} - export PLUGINS=${{ matrix.test_plugin }} - pip install nox dataclasses --progress-bar off - nox -s lint_plugins test_plugins test_plugins_vs_core -ts - test_plugin_macos: - if: ${{ inputs.plugin_test }} - runs-on: macos-latest - strategy: - matrix: - py_version: - - '3.8' - - '3.9' - - '3.10' - - '3.11' - test_plugin: - - "${{ inputs.test_plugins }}" - steps: - - uses: actions/checkout@v4.1.0 - - uses: maxim-lobanov/setup-xcode@v1.6.0 - with: - xcode-version: 13.4.1 - - uses: "./.github/actions/macos" - with: - py_version: "${{ matrix.py_version }}" - - name: "${{ matrix.test_plugin }}" - run: |- - export NOX_PYTHON_VERSIONS=${{ matrix.py_version }} - export PLUGINS=${{ matrix.test_plugin }} - conda activate hydra - pip install nox dataclasses --progress-bar off - nox -s lint_plugins test_plugins test_plugins_vs_core -ts - test_plugin_win: - if: ${{ inputs.plugin_test }} - runs-on: ubuntu-latest - strategy: - matrix: - py_version: - - '3.8' - - '3.9' - - '3.10' - - '3.11' - test_plugin: - - "${{ inputs.test_plugins }}" - steps: -# # This item has no matching transformer -# - circleci_windows_: - - name: "${{ matrix.test_plugin }}" - run: |- - $env:NOX_PYTHON_VERSIONS="${{ matrix.py_version }}" - $env:ConEmuDefaultCp=65001 - $env:PYTHONIOENCODING="utf_8" - $env:PLUGINS="${{ matrix.test_plugin }}" - conda activate hydra - nox -s lint_plugins test_plugins test_plugins_vs_core -ts - exit $LASTEXITCODE