From afc7e82714c24c92ea509940171eb1c5927bcf95 Mon Sep 17 00:00:00 2001 From: jmulford-bandwidth Date: Tue, 10 Nov 2020 14:02:47 -0500 Subject: [PATCH 1/2] DX-1612 added simple PR check --- .github/actions/validate/Dockerfile | 11 +++++++++++ .github/actions/validate/action.yml | 6 ++++++ .github/actions/validate/entrypoint.sh | 7 +++++++ .github/workflows/validate.yaml | 16 ++++++++++++++++ 4 files changed, 40 insertions(+) create mode 100644 .github/actions/validate/Dockerfile create mode 100644 .github/actions/validate/action.yml create mode 100644 .github/actions/validate/entrypoint.sh create mode 100644 .github/workflows/validate.yaml diff --git a/.github/actions/validate/Dockerfile b/.github/actions/validate/Dockerfile new file mode 100644 index 00000000..6977b083 --- /dev/null +++ b/.github/actions/validate/Dockerfile @@ -0,0 +1,11 @@ +# Container image that runs your code +FROM python:3 + +# Copies your code file from your action repository to the filesystem path `/` of the container +COPY entrypoint.sh /entrypoint.sh + +#Make entrypoint.sh exacutable +RUN chmod +x /entrypoint.sh + +# Code file to execute when the docker container starts up (`entrypoint.sh`) +ENTRYPOINT ["/entrypoint.sh"] diff --git a/.github/actions/validate/action.yml b/.github/actions/validate/action.yml new file mode 100644 index 00000000..38f99b06 --- /dev/null +++ b/.github/actions/validate/action.yml @@ -0,0 +1,6 @@ +# action.yml +name: 'Deploy' +description: 'Deploys the python sdk to PYPI' +runs: + using: 'docker' + image: 'Dockerfile' diff --git a/.github/actions/validate/entrypoint.sh b/.github/actions/validate/entrypoint.sh new file mode 100644 index 00000000..bb4e395c --- /dev/null +++ b/.github/actions/validate/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +pip install twine +pip install wheel +python setup.py sdist bdist_wheel + +twine check dist/* diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml new file mode 100644 index 00000000..329fc23d --- /dev/null +++ b/.github/workflows/validate.yaml @@ -0,0 +1,16 @@ +name: Validate SDK + +on: + pull_request: + branches: + - 'master' + +jobs: + deploy: + name: Validate + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Validate + uses: ./.github/actions/validate From e12e1660aabccd3327180730420659db2635fa3b Mon Sep 17 00:00:00 2001 From: jmulford-bandwidth Date: Tue, 10 Nov 2020 14:05:14 -0500 Subject: [PATCH 2/2] copypaste is hard --- .github/actions/validate/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/validate/action.yml b/.github/actions/validate/action.yml index 38f99b06..95452b09 100644 --- a/.github/actions/validate/action.yml +++ b/.github/actions/validate/action.yml @@ -1,6 +1,6 @@ # action.yml -name: 'Deploy' -description: 'Deploys the python sdk to PYPI' +name: 'Validate' +description: 'Validates the package' runs: using: 'docker' image: 'Dockerfile'