Skip to content

POC: Move test job to GitHub workflow. Refs #192 #1

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
6 changes: 3 additions & 3 deletions .travis/before-deploy.sh → .ci/before-deploy.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down
6 changes: 3 additions & 3 deletions .travis/before-docs-deploy.sh → .ci/before-docs-deploy.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion .travis/build.sh → .ci/build.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion .travis/lib-setup.sh → .ci/lib-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
34 changes: 34 additions & 0 deletions .github/workflows/deploy_latest_docs.yml
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions .github/workflows/run-on-linux.sh
Original file line number Diff line number Diff line change
@@ -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
137 changes: 137 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -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
73 changes: 10 additions & 63 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,88 +6,35 @@ 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

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:
- 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-deploy.sh
- source ./.ci/lib-util.sh
- util::docker-run $DISTRO ./.ci/before-deploy.sh
- ls -alR `pwd`

deploy:
Expand All @@ -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
Expand All @@ -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"
Expand Down