Skip to content
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

feat: Moving from Travis to GitHub Actions #2464

Merged
merged 16 commits into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Gen3utils Validation

on:
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'PR commits + 1'
run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"

- name: 'Checkout PR branch and all PR commits'
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: ${{ env.PR_FETCH_DEPTH }}

- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install gen3utils --upgrade

- name: Remove comments from github-actions
uses: actions/github-script@v6
if: github.event_name == 'pull_request'
with:
script: |
async function removeComments() {
const { owner, repo, number } = context.issue;
const commentsResponse = await github.rest.issues.listComments({ owner, repo, issue_number: number });
const comments = commentsResponse.data;

for (const comment of comments) {
if (comment.user.login === 'github-actions[bot]') {
await github.rest.issues.deleteComment({ owner, repo, comment_id: comment.id });
}
}
}

await removeComments();

- name: Validate manifest.json, etlMapping.yaml, and gitops.json
run: |
changed_files=$(git diff --name-only HEAD..${{ github.event.pull_request.base.sha }})
envs=()
for file in $changed_files; do
envs+=($(echo "$file" | cut -d "/" -f1))
done

# remove duplicates
envs=($(printf "%s\n" "${envs[@]}" | sort -u))
echo "${uniq[@]}"
echo "Updated: ${envs[@]}"

PR_LABELS=$(curl -s "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels")
if [[ $PR_LABELS == *"skip-gen3utils"* ]]; then
echo "skipping gen3utils checks..."
exit 0
fi

for dir in "${envs[@]}"; do
echo " Validating $dir"
man=$dir/manifest.json; etl=$dir/etlMapping.yaml; ptlcfg=$dir/portal/gitops.json;

# validate manifest.json
if [ -f $man ]; then
gen3utils validate-manifest $man || exit 1
fi

# validate ETL mapping
if [ -f $man ] && [ -f $etl ]; then
gen3utils validate-etl-mapping $etl $man || exit 1
fi

# validate portal configuration
if [ -f $man ] && [ -f $etl ] && [ -f $ptlcfg ]; then
gen3utils validate-portal-config $etl $man $ptlcfg ${{ github.repository }} ${{ github.event.pull_request.number }} || exit 1
fi
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Comment on PRs with relevant deployment changes
if: github.event_name == 'pull_request'
run: |
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
gen3utils post-deployment-changes ${{ github.repository }} ${{ github.event.pull_request.number }}
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68 changes: 0 additions & 68 deletions .travis.yml

This file was deleted.

32 changes: 16 additions & 16 deletions qa-midrc.planx-pla.net/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@
],
"versions": {
"ambassador": "quay.io/datawire/ambassador:1.4.2",
"arborist": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/arborist:2023.04",
"arborist": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/arborist:2023.05",
"aws-es-proxy": "quay.io/cdis/aws-es-proxy:v1.3.1",
"dashboard": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/gen3-statics:2023.04",
"dashboard": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/gen3-statics:2023.05",
"dicom-viewer": "quay.io/cdis/ohif-viewer:master-rebase",
"dicom-server": "quay.io/cdis/gen3-orthanc:master",
"fence": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/fence:2023.04",
"fence": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/fence:2023.05",
"fluentd": "fluent/fluentd-kubernetes-daemonset:v1.15.3-debian-cloudwatch-1.0",
"guppy": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/guppy:2023.04",
"indexd": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/indexd:2023.04",
"manifestservice": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/manifestservice:2023.04",
"metadata": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/metadata-service:2023.04",
"peregrine": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/peregrine:2023.04",
"pidgin": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/pidgin:2023.04",
"portal": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/data-portal:2023.04",
"guppy": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/guppy:2023.05",
"indexd": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/indexd:2023.05",
"manifestservice": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/manifestservice:2023.05",
"metadata": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/metadata-service:2023.05",
"peregrine": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/peregrine:2023.05",
"pidgin": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/pidgin:2023.05",
"portal": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/data-portal:2023.05",
"frontend-framework": "quay.io/cdis/frontend-framework:feat_n3c",
"revproxy": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/nginx:2023.04",
"sheepdog": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/sheepdog:2023.04",
"spark": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/gen3-spark:2023.04",
"ssjdispatcher": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/ssjdispatcher:2023.04",
"tube": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/tube:2023.04",
"wts": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/workspace-token-service:2023.04"
"revproxy": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/nginx:2023.05",
"sheepdog": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/sheepdog:2023.05",
"spark": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/gen3-spark:2023.05",
"ssjdispatcher": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/ssjdispatcher:2023.05",
"tube": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/tube:2023.05",
"wts": "707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/workspace-token-service:2023.05"
},
"arborist": {
"deployment_version": "2"
Expand Down