-
Notifications
You must be signed in to change notification settings - Fork 10
Migrate from circleci to github actions #217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2d5b42c
Migrate from circleci to github actions
thodkatz 54b4c96
Close server when test fails
thodkatz df4c75b
Use python>=3.8 for build and 3.9 for testing
thodkatz 9676985
Consistent order of channels between builds
thodkatz d0aefac
Delete circle ci config
thodkatz 192b5ae
Bump pytorch>=2.3
thodkatz 8f4fa85
Restrict numpy<2 due to pytorch 2.2py39 build
thodkatz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,172 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| pre_commit_check: | ||
| name: Pre-Commit Check | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| shell: bash -l {0} | ||
| env: | ||
| BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - uses: conda-incubator/setup-miniconda@v3 | ||
| with: | ||
| auto-update-conda: true | ||
| auto-activate-base: false | ||
| activate-environment: tiktorch-server-env | ||
| environment-file: environment.yml | ||
| channel-priority: flexible | ||
| miniforge-variant: Miniforge3 | ||
| - name: Run Pre-Commit | ||
| run: | | ||
| echo $BRANCH_NAME | ||
| echo ${{ github.event.pull_request.base.ref }} | ||
| echo ${{ github.event.pull_request.head.sha }} | ||
| git fetch origin | ||
| pre-commit run --from-ref origin/${{ github.event.pull_request.base.ref }} --to-ref ${{ github.event.pull_request.head.sha }} | ||
|
|
||
| test-dev: | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| shell: bash -l {0} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - uses: conda-incubator/setup-miniconda@v3 | ||
| with: | ||
| auto-update-conda: true | ||
| auto-activate-base: false | ||
| activate-environment: tiktorch-server-env | ||
| environment-file: environment.yml | ||
| channel-priority: flexible | ||
| miniforge-variant: Miniforge3 | ||
| - name: conda diagnostics | ||
| run: | | ||
| conda list | ||
| conda info | ||
| - name: install submodules | ||
| run: | | ||
| git submodule init | ||
| git submodule update | ||
| make install_submodules | ||
| - name: Run tests | ||
| run: | | ||
| pytest -v -s --cov=tiktorch --cov-report=xml | ||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v4 | ||
| with: | ||
| file: ./coverage.xml | ||
| fail_ci_if_error: true | ||
| env: | ||
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
|
|
||
|
|
||
| conda-noarch-build: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| version: ${{ steps.version.outputs.version }} | ||
| defaults: | ||
| run: | ||
| shell: bash -l {0} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: conda-incubator/setup-miniconda@v3 | ||
| with: | ||
| auto-update-conda: true | ||
| auto-activate-base: true | ||
| channel-priority: flexible | ||
| miniforge-variant: Miniforge3 | ||
| - name: install common conda dependencies | ||
| run: conda install -n base -c conda-forge conda-build setuptools_scm -y | ||
| - name: Cache Conda Packages | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| pkgs/noarch | ||
| pkgs/channeldata.json | ||
| key: ${{ github.sha }}-packages | ||
| - id: version | ||
| run: | | ||
| vers=$( python setup.py --version ) | ||
| echo "version=${vers}" >> $GITHUB_OUTPUT | ||
| - name: Linux Conda Build | ||
| run: | | ||
| mkdir -p ./pkgs/noarch | ||
| conda build -c ilastik-forge -c pytorch -c conda-forge \ | ||
| conda-recipe --no-test --output-folder ./pkgs | ||
|
|
||
| test-build-conda-packages: | ||
| needs: [conda-noarch-build] | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [macos-latest, windows-latest, ubuntu-latest] | ||
| runs-on: ${{ matrix.os }} | ||
| env: | ||
| TIKTORCH_PACKAGE_NAME: tiktorch-${{ needs.conda-noarch-build.outputs.version }}-py_0.tar.bz2 | ||
| steps: | ||
| # Use GNU tar instead of BSD tar on Windows | ||
| - name: "Use GNU tar instead of BSD tar" | ||
| if: matrix.os == 'windows-latest' | ||
| shell: cmd | ||
| run: echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%" | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: conda-incubator/setup-miniconda@v3 | ||
| with: | ||
| auto-update-conda: true | ||
| auto-activate-base: true | ||
| channel-priority: flexible | ||
| miniforge-variant: Miniforge3 | ||
| - name: install common conda dependencies | ||
| run: conda install -n base -c conda-forge conda-build setuptools_scm -y | ||
| - name: Cache Conda Packages | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| pkgs/noarch | ||
| pkgs/channeldata.json | ||
| key: ${{ github.sha }}-packages | ||
| enableCrossOsArchive: true | ||
| - name: Linux Test | ||
| if: matrix.os == 'ubuntu-latest' | ||
| shell: bash -l {0} | ||
| run: | | ||
| conda build --test --override-channels \ | ||
| -c ./pkgs -c ilastik-forge -c pytorch -c conda-forge \ | ||
| ./pkgs/noarch/${TIKTORCH_PACKAGE_NAME} | ||
| - name: macOS Test | ||
| if: matrix.os == 'macos-latest' | ||
| shell: bash -l {0} | ||
| run: | | ||
| conda build --test --override-channels \ | ||
| -c ./pkgs -c ilastik-forge -c pytorch -c conda-forge \ | ||
| ./pkgs/noarch/${TIKTORCH_PACKAGE_NAME} | ||
| - name: Windows Test | ||
| if: matrix.os == 'windows-latest' | ||
| # HACK: due to a bug in conda-build need to point to | ||
| # libarchive explicitly. | ||
| # https://github.com/conda/conda/issues/12563#issuecomment-1494264704 | ||
| env: | ||
| LIBARCHIVE: C:\Miniconda\Library\bin\archive.dll | ||
| shell: cmd /C CALL {0} | ||
| run: | | ||
| conda build --test --override-channels ^ | ||
| -c %CD%\pkgs -c ilastik-forge -c pytorch -c conda-forge ^ | ||
| .\pkgs\noarch\%TIKTORCH_PACKAGE_NAME% | ||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -28,5 +28,4 @@ install_submodules: | |
| remove_devenv: | ||
| conda env remove --yes --name $(TIKTORCH_ENV_NAME) | ||
|
|
||
|
|
||
| .PHONY: * | ||
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.