-
Notifications
You must be signed in to change notification settings - Fork 279
github actions utest #169
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
DusanJovic-NOAA
merged 22 commits into
ufs-community:develop
from
MinsukJi-NOAA:feature/ContInteg
Sep 9, 2020
Merged
github actions utest #169
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
b476468
add ci-related files. update utest
MinsukJi-NOAA 489bfc0
Merge remote-tracking branch 'upstream/develop' into feature/ContInteg
MinsukJi-NOAA dc13d67
modify to auto-run different cases based on ci.test
MinsukJi-NOAA 2e3410e
update to the latest develop and make changes accordingly
MinsukJi-NOAA d13dd8c
Improve CI workflow
MinsukJi-NOAA cb8cefa
add clean-up after utest run
MinsukJi-NOAA 27941d7
fix docker container and image delete
MinsukJi-NOAA 4d60345
Merge remote-tracking branch 'upstream/develop' into feature/ContInteg
MinsukJi-NOAA 83a51f2
use ci-test-base v3. modify utest to comply with recent weather changes
MinsukJi-NOAA cbe85e8
add workflow manage files
MinsukJi-NOAA 499abe1
Add hera RT results
MinsukJi-NOAA 2cf9f90
Add dell RT results. skip-ci
MinsukJi-NOAA f4c97c5
Add orion RT results. skip-ci
MinsukJi-NOAA d5d7984
Merge remote-tracking branch 'upstream/develop' into feature/ContInteg
MinsukJi-NOAA ab73f9f
move parsing in main.yml to a separate script file
MinsukJi-NOAA 6b3b4b7
revert utest mpi test back to original setting. modify usage
MinsukJi-NOAA fb444d8
In utest change Hera queue, and Orion baseline location. skip-ci
MinsukJi-NOAA 11fb6b5
Temporarily turn off restart test in actions
MinsukJi-NOAA c700269
Attach logs for Hera Regression tests and Unit tests. skip-ci
MinsukJi-NOAA c0e281b
Attach logs for Dell Regression tests and Unit tests. skip-ci
a4ab091
Attach logs for Orion Regression tests and Unit tests. skip-ci
MinsukJi-NOAA 7caa213
Change actions workflow branch name to develop
MinsukJi-NOAA 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 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,5 @@ | ||
| Dockerfile | ||
| .git | ||
| .gitignore | ||
| tests/*.log | ||
| tests/log_ut_linux.gnu | ||
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,121 @@ | ||
| name: Pull Request Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - develop | ||
| pull_request: | ||
| branches: | ||
| - develop | ||
|
|
||
| jobs: | ||
| setup: | ||
| name: Set up | ||
| runs-on: ubuntu-latest | ||
|
|
||
| outputs: | ||
| tn: ${{ steps.parse.outputs.tn }} | ||
| bld: ${{ steps.parse.outputs.bld }} | ||
| test: ${{ steps.parse.outputs.test }} | ||
| img: ${{ steps.parse.outputs.img }} | ||
|
|
||
| steps: | ||
| - name: Checkout codes | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: Parse cases | ||
|
MinsukJi-NOAA marked this conversation as resolved.
|
||
| id: parse | ||
| run: | | ||
| cd ${GITHUB_WORKSPACE}/tests/ci | ||
| parsed_output=( $(./parse.sh) ) | ||
| name_=${parsed_output[0]} | ||
| bld_=${parsed_output[1]} | ||
| test_=${parsed_output[2]} | ||
| img_=${parsed_output[3]} | ||
|
|
||
| echo "::set-output name=tn::$name_" | ||
| echo "::set-output name=bld::$bld_" | ||
| echo "::set-output name=test::$test_" | ||
| echo "::set-output name=img::$img_" | ||
|
|
||
| echo "test name : $name_" | ||
| echo "build set : $bld_" | ||
| echo "test set : $test_" | ||
| echo "image name: $img_" | ||
|
|
||
| build: | ||
| name: Build (${{ matrix.bld_set }}) | ||
| needs: setup | ||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: ${{ fromJson(needs.setup.outputs.bld) }} | ||
|
|
||
| steps: | ||
| - name: Checkout codes | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Build | ||
| run: | | ||
| printf '{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json >/dev/null | ||
| sudo systemctl restart docker | ||
| sleep 10 | ||
| cd tests/ci && ./ci.sh -n ${{ needs.setup.outputs.tn }} -b ${{ matrix.bld_set }} | ||
|
|
||
| - name: Free up disk space | ||
| run: | | ||
| sudo docker rmi $(sudo docker image ls | grep -E -m1 '<none>' | awk '{ print $3 }') | ||
| sudo docker rmi $(sudo docker image ls | awk '/ci-test-base/ { print $3 }') | ||
|
|
||
| - name: Prepare artifacts | ||
| run: | | ||
| cd tests/ci | ||
| sudo docker save ${{ needs.setup.outputs.img }} | gzip >${{ needs.setup.outputs.img }}.tar.gz | ||
| tar cvjf artifact.tar.bz2 ${{ needs.setup.outputs.img }}.tar.gz ci.sh ci.test | ||
|
|
||
| - name: Upload artifacts | ||
| uses: actions/upload-artifact@v2 | ||
| with: | ||
| name: ${{ matrix.bld_set }}.artifact.tar.bz2 | ||
| path: tests/ci/artifact.tar.bz2 | ||
|
|
||
| utest: | ||
| name: Unit test (${{ needs.setup.outputs.tn }}, ${{ matrix.test_set }}) | ||
| needs: [setup,build] | ||
| runs-on: ubuntu-latest | ||
| #runs-on: self-hosted | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: ${{ fromJson(needs.setup.outputs.test) }} | ||
|
|
||
| steps: | ||
| - name: Download artifacts | ||
| uses: actions/download-artifact@v2 | ||
| with: | ||
| name: ${{ matrix.artifact }}.artifact.tar.bz2 | ||
|
|
||
| - name: Prepare artifacts | ||
| run: | | ||
| tar xvjf artifact.tar.bz2 && rm -f artifact.tar.bz2 | ||
| sudo docker load --input ${{ needs.setup.outputs.img }}.tar.gz && rm -f ${{ needs.setup.outputs.img }}.tar.gz | ||
|
|
||
| - name: Run utest | ||
| run: ./ci.sh -n ${{ needs.setup.outputs.tn }} -r ${{ matrix.test_set }} | ||
|
|
||
| - name: Upload memory usage file | ||
| if: ${{ always() }} | ||
| uses: actions/upload-artifact@v2 | ||
| with: | ||
| name: memory_stat_${{ matrix.test_set }} | ||
| path: memory_stat | ||
|
|
||
| - name: Clean up | ||
| if: ${{ always() }} | ||
| run: | | ||
| rm -f ci.sh ci.test | ||
| sudo docker rm my-container && sudo docker rmi ${{ needs.setup.outputs.img }}:latest | ||
| sudo docker volume rm DataVolume | ||
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,54 @@ | ||
| name: Manage workflows | ||
|
MinsukJi-NOAA marked this conversation as resolved.
|
||
|
|
||
| on: | ||
| workflow_run: | ||
| workflows: ["Pull Request Tests"] | ||
| types: | ||
| - requested | ||
|
|
||
| jobs: | ||
| job1: | ||
| name: Job 1 | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout codes | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: Check if skip-ci is requested | ||
| run: | | ||
| cd ${GITHUB_WORKSPACE}/tests/ci | ||
| repo="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/actions/runs" | ||
| tr_id=$(cat ${GITHUB_EVENT_PATH} | ./json_helper.py get_trigger_id) | ||
| tr_br=$(cat ${GITHUB_EVENT_PATH} | ./json_helper.py get_trigger_br) | ||
| check=$(cat ${GITHUB_EVENT_PATH} | ./json_helper.py check_skip) | ||
| echo "::set-env name=TRIGGER_ID::${tr_id}" | ||
| echo "::set-env name=TRIGGER_BR::${tr_br}" | ||
| echo "skip-ci: ${check}" | ||
| if [[ $check == yes ]]; then | ||
| echo "skip-ci is requested" | ||
| echo '::set-env name=CURR_JOB::cancelled' | ||
| curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" ${repo}/$tr_id/cancel | ||
| else | ||
| echo '::set-env name=CURR_JOB::running' | ||
| fi | ||
|
|
||
| - name: Cancel redundant jobs | ||
| run: | | ||
| echo "CURR_JOB is $CURR_JOB" | ||
| echo "TRIGGER_ID is $TRIGGER_ID" | ||
| echo "TRIGGER_BR is $TRIGGER_BR" | ||
| export GITHUB_ACTOR | ||
| export GITHUB_RUN_ID | ||
| export TRIGGER_ID | ||
| export TRIGGER_BR | ||
| cd ${GITHUB_WORKSPACE}/tests/ci | ||
| repo="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/actions/runs" | ||
| cancel_ids=$(curl -H "Accept: application/vnd.github.v3+json" ${repo} | ./json_helper.py cancel_workflow) | ||
| echo "cancel ids: $cancel_ids" | ||
| if [[ $cancel_ids != '' ]]; then | ||
| for i in $cancel_ids; do | ||
| curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" ${repo}/$i/cancel | ||
| done | ||
| fi | ||
| if: ${{ env.CURR_JOB == 'running' }} | ||
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.