Skip to content

Commit f5dd723

Browse files
authored
Avoid innecessary stub generation (#8654)
* FINAL TEST * Change version * test commit * echo commits * echo last commits before generating stubs * Fix bugs * fix more bugs * fix yaml error * try with a different version * Check we can get last commits * add variables in options * Echo commits * tweaks * More tweaks * Add an exception * FINAL TEST
1 parent 69d2f5a commit f5dd723

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/gh-actions.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0 # Ensures we fetch all history
1618

1719
- name: Liberate disk space
1820
uses: jlumbroso/free-disk-space@main
@@ -28,9 +30,15 @@ jobs:
2830
options: --workdir /__w/Lean/Lean -v /home/runner/work:/__w -e GITHUB_REF=${{ github.ref }} -e PYPI_API_TOKEN=${{ secrets.PYPI_API_TOKEN }} -e ADDITIONAL_STUBS_REPOS=${{ secrets.ADDITIONAL_STUBS_REPOS }} -e QC_GIT_TOKEN=${{ secrets.QC_GIT_TOKEN }}
2931
shell: bash
3032
run: |
33+
# Add exception
34+
git config --global --add safe.directory /__w/Lean/Lean
35+
# Get Last Commit of the Current Tag
36+
TAG_COMMIT=$(git rev-parse HEAD) && echo "CURRENT BRANCH LAST COMMIT $TAG_COMMIT"
37+
# Get Last Commit of the master
38+
MASTER_COMMIT=$(git rev-parse origin/master) && echo "MASTER BRANCH LAST COMMIT $MASTER_COMMIT"
3139
# Build
3240
dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln && \
3341
# Run Tests
3442
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --blame-hang-timeout 300seconds --blame-crash --filter "TestCategory!=TravisExclude&TestCategory!=ResearchRegressionTests" -- TestRunParameters.Parameter\(name=\"log-handler\", value=\"ConsoleErrorLogHandler\"\) && \
3543
# Generate & Publish python stubs
36-
echo "GITHUB_REF $GITHUB_REF" && if [[ $GITHUB_REF = refs/tags/* ]]; then (chmod +x ci_build_stubs.sh && ./ci_build_stubs.sh -t -g -p); else echo "Skipping stub generation"; fi
44+
echo "GITHUB_REF $GITHUB_REF" && if [[ $GITHUB_REF = refs/tags/* && "$TAG_COMMIT" = "$MASTER_COMMIT" ]]; then echo "Generating stubs" && (chmod +x ci_build_stubs.sh && ./ci_build_stubs.sh -t -g -p); else echo "Skipping stub generation"; fi

0 commit comments

Comments
 (0)