Add workflow: germline-gpu #37
Workflow file for this 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
name: "yevis-test-pr" | ||
on: | ||
pull_request_target: | ||
branches: | ||
- main | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
issue_comment: | ||
types: | ||
- created | ||
# https://docs.github.com/ja/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token | ||
permissions: | ||
pull-requests: write | ||
actions: read | ||
jobs: | ||
test: | ||
runs-on: ubuntu-20.04 | ||
if: > | ||
(github.event_name == 'issue_comment' && | ||
contains(github.event.comment.html_url, '/pull/') && | ||
startsWith(github.event.comment.body, '/re-run') && | ||
!contains(github.event.issue.labels.*.name, 'nig-gpu')) || | ||
(github.event_name == 'pull_request_target' && | ||
!contains(github.event.pull_request.labels.*.name, 'nig-gpu')) | ||
steps: | ||
- name: "Set environment variables" | ||
id: set-env | ||
run: | | ||
if [[ "${{ github.event_name }}" == "issue_comment" ]]; then | ||
echo "PR_URL=${{ github.event.issue.html_url }}" >> $GITHUB_ENV | ||
echo "PR_NUM=${{ github.event.issue.number }}" >> $GITHUB_ENV | ||
elif [[ "${{ github.event_name }}" == "pull_request_target" ]]; then | ||
echo "PR_URL=${{ github.event.pull_request.html_url }}" >> $GITHUB_ENV | ||
echo "PR_NUM=${{ github.event.pull_request.number }}" >> $GITHUB_ENV | ||
fi | ||
- name: "Download yevis binary from artifact" | ||
id: download-binary-artifact | ||
run: | | ||
RUN_ID=`gh run --repo sapporo-wes/yevis-cli list --workflow build_binary --json databaseId --jq .[0].databaseId` | ||
gh run --repo sapporo-wes/yevis-cli download ${RUN_ID} -n yevis | ||
chmod +x yevis | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
continue-on-error: true | ||
- name: "Download yevis binary from release" | ||
if: ${{ steps.download-binary-artifact.outcome != 'success' }} | ||
run: | | ||
curl -fsSL -O https://github.com/sapporo-wes/yevis-cli/releases/latest/download/yevis | ||
chmod +x ./yevis | ||
- name: "Run tests" | ||
id: test | ||
run: | | ||
Check failure on line 60 in .github/workflows/yevis-test-pr.yml GitHub Actions / yevis-test-prInvalid workflow file
|
||
mkdir -p ./test-logs ./test-results | ||
SAPPORO_RUN_DIR=${GITHUB_WORKSPACE}/test-results \ | ||
./yevis test \ | ||
--verbose \ | ||
--fetch-ro-crate \ | ||
--from-pr ${{ PR_URL }} \ | ||
2>&1 | tee ./test-logs/yevis-log.txt | ||
exit ${PIPESTATUS[0]} | ||
continue-on-error: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: "List test results" | ||
run: sudo ls -lR ./test-results > ./test-logs/test-results-list.txt | ||
- name: "Upload test logs" | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: yevis-test-logs | ||
path: test-logs/* | ||
if-no-files-found: ignore | ||
- name: "Comment to the pull request" | ||
run: | | ||
if [[ "${{ steps.test.outcome }}" == "success" ]]; then | ||
gh pr --repo ${{ github.repository }} edit ${{ PR_NUM }} --remove-label invalid | ||
else | ||
gh pr --repo ${{ github.repository }} edit ${{ PR_NUM }} --add-label invalid | ||
fi | ||
COMMENT=$(cat <<EOF | ||
## Test results | ||
- Test status: ${{ steps.test.outcome }} | ||
- Test URL: https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID} | ||
- Test logs artifact: yevis-test-logs | ||
EOF | ||
) | ||
gh pr --repo ${{ github.repository }} comment ${{ PR_NUM }} --body "${COMMENT}" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: "Check test status" | ||
if: steps.test.outcome != 'success' | ||
run: exit 1 |