diff --git a/.travis/before-deploy-windows-wheels.sh b/.ci/before-deploy-windows-wheels.sh similarity index 89% rename from .travis/before-deploy-windows-wheels.sh rename to .ci/before-deploy-windows-wheels.sh index 000d62a5..ced1ddfe 100644 --- a/.travis/before-deploy-windows-wheels.sh +++ b/.ci/before-deploy-windows-wheels.sh @@ -2,10 +2,10 @@ # See before-deploy.sh for anything unexplained -source ./.travis/lib-setup.sh -source ./.travis/lib-deploy.sh +source ./.ci/lib-setup.sh +source ./.ci/lib-deploy.sh -./.travis/build.sh +./.ci/build.sh # Sigh, go find paths again PYPATH="/c/Python${PYENV:0:1}${PYENV:2:1}" diff --git a/.travis/before-deploy.sh b/.ci/before-deploy.sh similarity index 94% rename from .travis/before-deploy.sh rename to .ci/before-deploy.sh index 91e198b9..44666134 100755 --- a/.travis/before-deploy.sh +++ b/.ci/before-deploy.sh @@ -1,13 +1,13 @@ #!/bin/bash -ex -source ./.travis/lib-setup.sh -source ./.travis/lib-deploy.sh +source ./.ci/lib-setup.sh +source ./.ci/lib-deploy.sh # build again since I can't figure out how to get travis to recognize the old # build in the new container. The other alternative (besides actually solving # the issue) is to run the docs build and tarball generation every time. -./.travis/build.sh +./.ci/build.sh setup::activate diff --git a/.travis/before-docs-deploy.sh b/.ci/before-docs-deploy.sh similarity index 78% rename from .travis/before-docs-deploy.sh rename to .ci/before-docs-deploy.sh index 6860771a..72f236a1 100644 --- a/.travis/before-docs-deploy.sh +++ b/.ci/before-docs-deploy.sh @@ -1,13 +1,13 @@ #!/bin/bash -ex -source ./.travis/lib-setup.sh -source ./.travis/lib-deploy.sh +source ./.ci/lib-setup.sh +source ./.ci/lib-deploy.sh # build again since I can't figure out how to get travis to recognize the old # build in the new container. The other alternative (besides actually solving # the issue) is to run the docs build and tarball generation every time. -./.travis/build.sh +./.ci/build.sh setup::activate diff --git a/.travis/build.sh b/.ci/build.sh similarity index 97% rename from .travis/build.sh rename to .ci/build.sh index 778b4411..9bba1925 100755 --- a/.travis/build.sh +++ b/.ci/build.sh @@ -1,7 +1,7 @@ #!/bin/bash -ex # set up dependencies, etc -source ./.travis/lib-setup.sh +source ./.ci/lib-setup.sh setup::install if [ x"$FLAKE" = "xyes" ]; then diff --git a/.travis/deploy-win.sh b/.ci/deploy-win.sh similarity index 100% rename from .travis/deploy-win.sh rename to .ci/deploy-win.sh diff --git a/.travis/docs-deploy.sh b/.ci/docs-deploy.sh similarity index 100% rename from .travis/docs-deploy.sh rename to .ci/docs-deploy.sh diff --git a/.travis/lib-deploy.sh b/.ci/lib-deploy.sh similarity index 100% rename from .travis/lib-deploy.sh rename to .ci/lib-deploy.sh diff --git a/.travis/lib-setup.sh b/.ci/lib-setup.sh similarity index 98% rename from .travis/lib-setup.sh rename to .ci/lib-setup.sh index 0f0c4ce2..cd6bb03e 100644 --- a/.travis/lib-setup.sh +++ b/.ci/lib-setup.sh @@ -78,7 +78,7 @@ setup::macos::install() { setup::windows::install() { # Install the right Python version and MIT Kerberos - choco install python"${PYENV:0:1}" --version $PYENV + choco install python"${PYENV:0:1}" --version $PYENV || true choco install mitkerberos --install-arguments "'ADDLOCAL=ALL'" || true PYPATH="/c/Python${PYENV:0:1}${PYENV:2:1}" # Update path to include them diff --git a/.travis/lib-util.sh b/.ci/lib-util.sh similarity index 100% rename from .travis/lib-util.sh rename to .ci/lib-util.sh diff --git a/.github/workflows/deploy_latest_docs.yml b/.github/workflows/deploy_latest_docs.yml new file mode 100644 index 00000000..161e92cc --- /dev/null +++ b/.github/workflows/deploy_latest_docs.yml @@ -0,0 +1,34 @@ +name: deploy latest docs + +on: + push: + branches: + - master + # TODO: not sure if the original was meant to mean a branch named 'infra' + # or any branch prefixed by 'infra/' ? The regex suggests it was the former + # but why there was a regex instead of direct name comparison then ? + - 'infra/**' + +jobs: + deploy-latest-docs: + runs-on: ubuntu-latest + name: 'deploy' + env: + DISTRO: 'fedora:latest' + PYTHON: 3 + # WARNING: make sure this doesn't leak b/c IDK if GitHub logs will protect it + # like Travis or not. Either way I don't think this line is necessary + # b/c the variable should be globally available. For more info: + # https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Deploy + run: | + ./.ci/lib-util.sh + util::docker-run $DISTRO ./.ci/before-docs-deploy.sh + + ./.ci/docs-deploy.sh travis_docs_build/html latest pythongssapi/python-gssapi diff --git a/.github/workflows/run-on-linux.sh b/.github/workflows/run-on-linux.sh new file mode 100755 index 00000000..d3064c19 --- /dev/null +++ b/.github/workflows/run-on-linux.sh @@ -0,0 +1,11 @@ +#!/bin/bash -ex +# +# We're using this script for running the test job b/c GitHub's parser +# doesn't support yaml anchors originally used in .travis.yml, see: +# https://github.community/t5/GitHub-Actions/Support-for-YAML-anchors/m-p/30336 +# + +sudo sed -i '1i 127.0.0.1 test.box' /etc/hosts +sudo hostname test.box +source ./.ci/lib-util.sh +util::docker-run $DISTRO ./.ci/build.sh diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml new file mode 100644 index 00000000..cc2d8f4a --- /dev/null +++ b/.github/workflows/testing.yml @@ -0,0 +1,137 @@ +name: testing + +on: + pull_request: + push: + branches: master + +jobs: + debian-stable-python-3: + runs-on: ubuntu-latest + name: 'debian:stable / Python 3' + env: + DISTRO: 'debian:stable' + PYTHON: 3 # 3.7 + + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Build and test gssapi + run: | + ./.github/workflows/run-on-linux.sh + + debian-stable-python-3-heimdal: + runs-on: ubuntu-latest + name: 'debian:stable / Python 3 / heimdal' + env: + DISTRO: 'debian:stable' + PYTHON: 3 + KRB5_VER: heimdal + + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Build and test gssapi + run: | + ./.github/workflows/run-on-linux.sh + + centos-8-python-3: + runs-on: ubuntu-latest + name: 'centos:8 / Python 3' + env: + DISTRO: 'centos:8' + PYTHON: 3 + + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Build and test gssapi + run: | + ./.github/workflows/run-on-linux.sh + + fedora-latest-python-3-flake-yes: + runs-on: ubuntu-latest + name: 'fedora:latest / Python 3 / flake8' + env: + DISTRO: 'fedora:latest' + PYTHON: 3 + FLAKE: yes + + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Build and test gssapi + run: | + ./.github/workflows/run-on-linux.sh + + macos-latest-python-3-heimdal: + runs-on: macos-latest + name: 'macos-latest / Python 3.6.3 / heimdal' + env: + PYTHON: 3 + PYENV: '3.6.3' + KRB5_VER: heimdal + + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Build and test gssapi + shell: bash + run: | + ./.ci/build.sh + + windows-latest-python-381: + runs-on: windows-latest + name: 'windows-latest / Python 3.8.1' + env: + PYTHON: 3 + PYENV: '3.8.1' + TRAVIS_OS_NAME: windows + + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Build and test gssapi + shell: bash + run: | + ./.ci/build.sh + + windows-latest-python-373: + runs-on: windows-latest + name: 'windows-latest / Python 3.7.3' + env: + PYTHON: 3 + PYENV: '3.7.3' + TRAVIS_OS_NAME: windows + + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Build and test gssapi + shell: bash + run: | + ./.ci/build.sh + + windows-latest-python-368: + runs-on: windows-latest + name: 'windows-latest / Python 3.6.8' + env: + PYTHON: 3 + PYENV: '3.6.8' + TRAVIS_OS_NAME: windows + + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Build and test gssapi + shell: bash + run: | + ./.ci/build.sh diff --git a/.travis.yml b/.travis.yml index 99694d75..3d31f3cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,14 +6,11 @@ language: python services: - docker -# we do everything in docker for non MacOS, MacOS setup is in .travis/build.sh +# we do everything in docker for non MacOS, MacOS setup is in .ci/build.sh install: skip before_install: skip stages: -- test -- name: deploy latest docs - if: (branch = master OR branch =~ ^infra/$) AND type = push - name: deploy if: tag is PRESENT @@ -21,64 +18,14 @@ script: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo sed -i '1i 127.0.0.1 test.box' /etc/hosts; sudo hostname test.box; - source ./.travis/lib-util.sh; - util::docker-run $DISTRO ./.travis/build.sh; + source ./.ci/lib-util.sh; + util::docker-run $DISTRO ./.ci/build.sh; fi -- if [[ "$TRAVIS_OS_NAME" != "linux" ]]; then ./.travis/build.sh; fi +- if [[ "$TRAVIS_OS_NAME" != "linux" ]]; then ./.ci/build.sh; fi jobs: # need to explictly define each builder for test due to different os types include: - - stage: test - env: DISTRO=debian:stable PYTHON="3" # 3.7 - - - stage: test - env: DISTRO=debian:stable PYTHON="3" KRB5_VER="heimdal" - - # el7 doesn't do python3 modules, and epel7's python3-gssapi is patched - - stage: test - env: DISTRO=centos:8 PYTHON="3" - - - stage: test - env: DISTRO=fedora:latest PYTHON="3" FLAKE="yes" - - # Travis defaults to 10.13 (i.e., not latest), so specify osx_image - - &osx_test - stage: test - env: PYTHON="3" KRB5_VER="heimdal" PYENV="3.6.3" - os: osx - osx_image: xcode9.2 - language: generic # causes issues with pyenv installer when set to python - - - &win_test - stage: test - env: PYTHON="3" PYENV="3.8.1" - os: windows - language: sh # Windows not supported yet - - - <<: *win_test - env: PYTHON="3" PYENV="3.7.3" - - - <<: *win_test - env: PYTHON="3" PYENV="3.6.8" - - - stage: deploy latest docs - script: skip - env: - - DISTRO=fedora:latest - - PYTHON="3" - - secure: L5SpEj5+no20PWwC9Y/XNhAfmUvYiuykwSMa/YyqvUuBjdizzpZcHr7Ego5nMdM1TniTxj4pSTM+GbM0FHCzNmAINSRh9g/D3hheRqlRBacqR0XwC9ZZRvkKvtzwnLh4vYWiauq4AoDeR5U6tkEcay6LjE57iMQcLjcKYBc+Eos= - before_deploy: - - source ./.travis/lib-util.sh - - util::docker-run $DISTRO ./.travis/before-docs-deploy.sh - - deploy: - - provider: script - script: .travis/docs-deploy.sh travis_docs_build/html latest pythongssapi/python-gssapi - skip_cleanup: true - on: - all_branches: true - - stage: deploy script: skip env: @@ -86,8 +33,8 @@ jobs: - PYTHON="3" - secure: L5SpEj5+no20PWwC9Y/XNhAfmUvYiuykwSMa/YyqvUuBjdizzpZcHr7Ego5nMdM1TniTxj4pSTM+GbM0FHCzNmAINSRh9g/D3hheRqlRBacqR0XwC9ZZRvkKvtzwnLh4vYWiauq4AoDeR5U6tkEcay6LjE57iMQcLjcKYBc+Eos= before_deploy: - - source ./.travis/lib-util.sh - - util::docker-run $DISTRO ./.travis/before-deploy.sh + - source ./.ci/lib-util.sh + - util::docker-run $DISTRO ./.ci/before-deploy.sh - ls -alR `pwd` deploy: @@ -109,11 +56,11 @@ jobs: docs_dir: travis_docs_build/html on: all_branches: true - # NB(directxman12): this is a hack. Check ./.travis/before-deploy.sh for an explanation. + # NB(directxman12): this is a hack. Check ./.ci/before-deploy.sh for an explanation. distributions: "check" - provider: script - script: .travis/docs-deploy.sh travis_docs_build/html stable pythongssapi/python-gssapi + script: .ci/docs-deploy.sh travis_docs_build/html stable pythongssapi/python-gssapi skip_cleanup: true on: all_branches: true @@ -122,8 +69,8 @@ jobs: stage: deploy os: windows script: # This is egregious hacks around Travis - - ./.travis/before-deploy-windows-wheels.sh - - ./.travis/deploy-win.sh + - ./.ci/before-deploy-windows-wheels.sh + - ./.ci/deploy-win.sh env: - PYTHON="3" - PYENV="3.8.1"