From fa690800deb46bfa35c8b705e3ef0f48c5bd8e9b Mon Sep 17 00:00:00 2001 From: John Tompkins Date: Fri, 13 Nov 2020 13:36:39 -0800 Subject: [PATCH 1/4] Add CI; keep travis for now to show compatibility --- .github/workflows/pr-ci.yml | 40 +++++++++++++++++++++++++++++++++++++ e2e-test.sh | 7 +++++++ 2 files changed, 47 insertions(+) create mode 100644 .github/workflows/pr-ci.yml create mode 100755 e2e-test.sh diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml new file mode 100644 index 0000000..a42dac1 --- /dev/null +++ b/.github/workflows/pr-ci.yml @@ -0,0 +1,40 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: CloudFormation Python Plugin CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + env: + AWS_DEFAULT_REGION: us-east-1 + runs-on: ubuntu-latest + strategy: + matrix: + python: [3.6, 3.7, 3.8, 3.9] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install --upgrade pip mypy 'attrs==19.2.0' -r https://raw.githubusercontent.com/aws-cloudformation/aws-cloudformation-rpdk/master/requirements.txt + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Install both plugin and support lib + run: | + pip install . src/ + - name: pre-commit checks + run: | + pre-commit run --all-files + - name: End to End Resource Packaging Test Python 3.6 + run: ./e2e-test.sh python36 + - name: End to End Resource Packaging Test Python 3.7 + run: ./e2e-test.sh python37 diff --git a/e2e-test.sh b/e2e-test.sh new file mode 100755 index 0000000..b0cc9c9 --- /dev/null +++ b/e2e-test.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +DIR=$(mktemp -d) +cd "$DIR" +ls -la +cfn init -t AWS::Foo::Bar $1 --use-docker +ls -la +mypy src/aws_foo_bar/ --strict --implicit-reexport From 15575cd02507c9aae9ed2ad28c18563efaba8eb4 Mon Sep 17 00:00:00 2001 From: John Tompkins Date: Fri, 13 Nov 2020 15:14:06 -0800 Subject: [PATCH 2/4] Remove python 3.9 --- .github/workflows/pr-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml index a42dac1..8d9b084 100644 --- a/.github/workflows/pr-ci.yml +++ b/.github/workflows/pr-ci.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: [3.6, 3.7, 3.8, 3.9] + python: [3.6, 3.7, 3.8] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python }} From 0425ada5d59019a5809f3a73b4b4e2da6e257875 Mon Sep 17 00:00:00 2001 From: John Tompkins Date: Mon, 16 Nov 2020 13:40:57 -0800 Subject: [PATCH 3/4] Remove travisci --- .travis.yml | 56 ----------------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index caa094a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,56 +0,0 @@ -language: python -dist: bionic -sudo: false -cache: - pip: true - directories: - - $HOME/.cache/pre-commit -before_install: -- > - pip install --upgrade pip mypy 'attrs==19.2.0' - -r https://raw.githubusercontent.com/aws-cloudformation/aws-cloudformation-rpdk/master/requirements.txt -install: -- pip install . src/ -env: - global: - - AWS_DEFAULT_REGION="us-east-1" -script: -- pre-commit run --all-files -jobs: - include: - - python: "3.6" - - python: "3.7" - - python: "3.8" - - stage: "integ python 3.6" - language: python - python: "3.6" - script: - - ls -la - - DIR=$(mktemp -d) - - cd "$DIR" - - ls -la - - printf "AWS::Foo::Bar\n1\ny" | cfn init -vv - - ls -la - - mypy src/aws_foo_bar/ --strict --implicit-reexport - - stage: "integ python 3.7" - language: python - python: "3.7" - script: - - DIR=$(mktemp -d) - - cd "$DIR" - - ls -la - - printf "AWS::Foo::Bar\n2\ny" | cfn init -vv - - ls -la - - mypy src/aws_foo_bar/ --strict --implicit-reexport - - stage: deploy - python: "3.7" - script: - - cd $(bash before_deploy.sh) - deploy: - provider: pypi - user: aws-cloudformation-developers - password: - secure: "KDSSnOhDMO3sHi4eeOSrsRcs3be5C1cYBdtnmTMOUz6npf39wsssBM6iJfkSdRdpWCr8k1cKodVhE3fcz+Z0vq33oPSWOvakynMrcRQk5Xe7Fzc53kesDEc562smPMiERtFfse0oO+InzIPjsfbsBzLqKlWWQGMqUxrshPmfexsOwKDo+JzT4lVflz6AGQPI0smXa9gHkAu11ne7mIlrmR7f8+mWgqzLTExIJFqYjNECOrT/gDo3zzySO13h5CXf7AM1i0o5p02b9hZ41blkS2OgBeDMSS9qN6QFPT+Erl6Q6y579/vM+knXlPzWBdbqJ2uWaeBfcZZlP7jNp6TkW1WPu4jPL/VnJ/3Eihy4rMkRBuer5zPHj0KBJZoU4jjZx5ctnsYPSZrH7Xo3CHnk1QNckXb+4GZVgz6EWAMGgRmDzJUWTzzu7Dw5EwFQZwESTETqqd+53Ht9yDeJgzA6OneZ4MsWq0OzjUFiiAKMS8BO/uiQrTv3/pJo75JJCLW8wrwTaBTZt6gTuYl+UNeuogITVCdStiH1ECZZ001Bv7tKDhcD4rVB/lJ/I8qIx9QXdWDiRhqqt1+WUl6tlA6sX2vFrTD2wqw9XNwNpIbHF8IoBRI9Cp5wO4m0CreAD6TYbPwEXKMyU5mCEQAv1zSJVag3hf/lhmAR3T7eLUPId2c=" - distributions: sdist bdist_wheel - on: - tags: true From 893ac49e54e21ea50d06beb6b1ddf8772c3a25fd Mon Sep 17 00:00:00 2001 From: John Tompkins Date: Fri, 20 Nov 2020 14:08:20 -0800 Subject: [PATCH 4/4] Update .github/workflows/pr-ci.yml Co-authored-by: Pat Myron --- .github/workflows/pr-ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml index 8d9b084..23e4e5b 100644 --- a/.github/workflows/pr-ci.yml +++ b/.github/workflows/pr-ci.yml @@ -25,9 +25,7 @@ jobs: python-version: ${{ matrix.python }} - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install --upgrade pip mypy 'attrs==19.2.0' -r https://raw.githubusercontent.com/aws-cloudformation/aws-cloudformation-rpdk/master/requirements.txt - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install --upgrade mypy 'attrs==19.2.0' -r https://raw.githubusercontent.com/aws-cloudformation/aws-cloudformation-rpdk/master/requirements.txt - name: Install both plugin and support lib run: | pip install . src/