-
Notifications
You must be signed in to change notification settings - Fork 729
Update CI workflow to fetch core files from open_dev branch #399
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -14,7 +14,7 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||||||||||||||||||||||||||||
| fail-fast: false | ||||||||||||||||||||||||||||||||||||||||||||||||
| matrix: | ||||||||||||||||||||||||||||||||||||||||||||||||
| os: [ubuntu-latest, windows-latest] | ||||||||||||||||||||||||||||||||||||||||||||||||
| os: [ubuntu-20.04, windows-latest] | ||||||||||||||||||||||||||||||||||||||||||||||||
| python-version: ["3.6"] | ||||||||||||||||||||||||||||||||||||||||||||||||
| defaults: | ||||||||||||||||||||||||||||||||||||||||||||||||
| run: | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -23,17 +23,37 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||
| timeout-minutes: 30 | ||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v3 | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Fetch core files from open_dev branch | ||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||
| git fetch origin open_dev | ||||||||||||||||||||||||||||||||||||||||||||||||
| git checkout origin/open_dev -- _core | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+29
to
+30
|
||||||||||||||||||||||||||||||||||||||||||||||||
| git fetch origin open_dev | |
| git checkout origin/open_dev -- _core | |
| set -e | |
| # Verify that the remote branch 'open_dev' exists | |
| if ! git ls-remote --exit-code origin open_dev >/dev/null 2>&1; then | |
| echo "Error: remote branch 'open_dev' not found on 'origin'." >&2 | |
| exit 1 | |
| fi | |
| # Fetch the latest state of the 'open_dev' branch | |
| git fetch origin open_dev | |
| # Attempt to check out the '_core' directory from the remote branch | |
| if ! git checkout origin/open_dev -- _core; then | |
| echo "Error: failed to check out '_core' directory from 'origin/open_dev'." >&2 | |
| exit 1 | |
| fi | |
| # Verify that the '_core' directory now exists | |
| if [ ! -d "_core" ]; then | |
| echo "Error: '_core' directory not found after checkout. Verify it exists in the 'open_dev' branch." >&2 | |
| exit 1 | |
| fi |
Copilot
AI
Feb 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script assumes that macOS runners will never be used. If the matrix is expanded to include macOS in the future, the OS_DIR will be set to "Linux" for macOS, which is likely incorrect. Consider adding an explicit check for macOS or documenting this limitation.
| else | |
| OS_DIR="Linux" | |
| elif [[ "$RUNNER_OS" == "Linux" ]]; then | |
| OS_DIR="Linux" | |
| else | |
| echo "Unsupported RUNNER_OS '$RUNNER_OS'. This workflow currently supports only Windows and Linux." | |
| exit 1 |
Copilot
AI
Feb 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copy operation lacks error handling and validation. If the source path "_core/${OS_DIR}/lib64/${PY_VERSION}/" doesn't exist or contains no files, the command will fail but the error may not be clear. Consider adding a check to verify the source directory exists and contains files before attempting the copy, or using 'set -e' to ensure the script fails fast on errors.
| cp -r "_core/${OS_DIR}/lib64/${PY_VERSION}/"* geatpy/core/ | |
| SRC_DIR="_core/${OS_DIR}/lib64/${PY_VERSION}" | |
| if [[ ! -d "$SRC_DIR" ]]; then | |
| echo "Error: Source directory '$SRC_DIR' does not exist." >&2 | |
| exit 1 | |
| fi | |
| shopt -s nullglob | |
| files=("$SRC_DIR"/*) | |
| if [[ ${#files[@]} -eq 0 ]]; then | |
| echo "Error: No files found to copy in '$SRC_DIR'." >&2 | |
| exit 1 | |
| fi | |
| cp -r "${files[@]}" geatpy/core/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python 3.6 reached end-of-life in December 2021 and is no longer supported. The change to ubuntu-20.04 may be to ensure Python 3.6 availability, but this creates a maintenance burden as ubuntu-20.04 itself will reach end-of-life soon (April 2025 for standard support). Consider upgrading to a supported Python version (3.8+) to ensure long-term maintainability and security.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is that the compiled core module are of python 3.6.