-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move copyright check out of PR action (#512)
- Loading branch information
1 parent
76b890e
commit 1bf0961
Showing
4 changed files
with
34 additions
and
38 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 |
---|---|---|
|
@@ -9,7 +9,30 @@ on: | |
workflow_dispatch: | ||
|
||
jobs: | ||
copyright: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Check for (and add) missing copyrights | ||
shell: bash | ||
run: | | ||
make copyright | ||
echo "NUM_MODIFIED=$(git diff --numstat | wc -l)" >> $GITHUB_ENV | ||
- name: Push changes | ||
if: env.NUM_MODIFIED != 0 | ||
shell: bash | ||
run: | | ||
git config core.fileMode false | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git add . | ||
git commit -m "updating copyrights from pre merge check in github action" | ||
git push -f origin HEAD:${GITHUB_HEAD_REF_NAME} | ||
check: | ||
needs: copyright | ||
name: Check modified files for Python SDK changes | ||
runs-on: ubuntu-latest | ||
outputs: | ||
|
@@ -29,16 +52,16 @@ jobs: | |
git diff --name-only HEAD^ HEAD >files.txt | ||
while IFS= read -r file; do | ||
if [[ $file != demos/python/sdk_wireless_camera_control* ]]; then | ||
echo "::set-output name=run_job::false" | ||
echo "{run_job}={false}" >> $GITHUB_OUTPUT | ||
else | ||
echo "Found a Python SDK modified file" | ||
echo "::set-output name=run_job::true" | ||
echo "{run_job}={true}" >> $GITHUB_OUTPUT | ||
break | ||
fi | ||
done <files.txt | ||
python_sdk: | ||
name: Build and Deploy Python SDK | ||
name: Build and Deploy Python SDK Documentation | ||
needs: check | ||
if: needs.check.outputs.run_job == 'true' | ||
runs-on: ${{ matrix.os }} | ||
|
@@ -104,7 +127,7 @@ jobs: | |
jekyll: | ||
name: Build and Deploy Jekyll Site | ||
needs: [check, python_sdk] | ||
needs: [copyright, check, python_sdk] | ||
if: always() | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
# This copyright was auto-generated on Wed, Sep 1, 2021 5:05:35 PM | ||
|
||
# This workflow will run pre-merge checks to verify a PR before it is merged: | ||
# - copyright: Checks to see if there are any missing copyrights | ||
|
||
name: Pre Merge Checks | ||
|
||
|
@@ -11,39 +10,7 @@ on: | |
branches: [main, develop, release] | ||
|
||
jobs: | ||
copyright: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Extract branch name | ||
shell: bash | ||
run: echo "##[set-output name=branch;]$(echo ${GITHUB_HEAD_REF#refs/heads/})" | ||
id: extract_branch | ||
|
||
- name: Checkout PR branch | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ steps.extract_branch.outputs.branch }} | ||
ssh-key: ${{ secrets.PUSH_FROM_WORKFLOW_TO_RETRIGGER }} | ||
|
||
- name: Check for (and add) missing copyrights | ||
shell: bash | ||
run: | | ||
make copyright | ||
echo "NUM_MODIFIED=$(git diff --numstat | wc -l)" >> $GITHUB_ENV | ||
- name: Push changes | ||
if: env.NUM_MODIFIED != 0 | ||
shell: bash | ||
run: | | ||
git config core.fileMode false | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git add . | ||
git commit -m "updating copyrights from pre merge check in github action" | ||
git push -f origin HEAD:${{ steps.extract_branch.outputs.branch }} | ||
test_github_pages: | ||
needs: copyright | ||
timeout-minutes: 5 | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -60,6 +27,7 @@ jobs: | |
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Test Jekyll Build and Check Links | ||
run: make tests | ||
|
||
|
@@ -71,7 +39,7 @@ jobs: | |
uses: actions/checkout@v3 | ||
with: | ||
ref: release | ||
ssh-key: ${{ secrets.PUSH_FROM_WORKFLOW_TO_RETRIGGER }} | ||
|
||
- name: Verify synchronized if release | ||
shell: bash | ||
run: | | ||
|
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
// Something |