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..95452b09 --- /dev/null +++ b/.github/actions/validate/action.yml @@ -0,0 +1,6 @@ +# action.yml +name: 'Validate' +description: 'Validates the package' +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