Skip to content

Commit dfb8402

Browse files
committed
Migrate from Travis CI to GitHub actions. Fixes pythongssapi#192
- rename .travis/ -> .ci/ - use a small script for running the test job b/c GitHub's parser doesn't support yaml anchors, see: https://github.community/t5/GitHub-Actions/Support-for-YAML-anchors/m-p/30336 - do not fail on Python installs in Windows environment, for example: https://github.com/atodorov/python-gssapi/pull/1/checks?check_run_id=601883334. Likely caused by the Python installer wanting to reboot Windows
1 parent 2d40e2b commit dfb8402

13 files changed

+203
-74
lines changed

.travis/before-deploy-windows-wheels.sh renamed to .ci/before-deploy-windows-wheels.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
# See before-deploy.sh for anything unexplained
44

5-
source ./.travis/lib-setup.sh
6-
source ./.travis/lib-deploy.sh
5+
source ./.ci/lib-setup.sh
6+
source ./.ci/lib-deploy.sh
77

8-
./.travis/build.sh
8+
./.ci/build.sh
99

1010
# Sigh, go find paths again
1111
PYPATH="/c/Python${PYENV:0:1}${PYENV:2:1}"

.travis/before-deploy.sh renamed to .ci/before-deploy.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/bin/bash -ex
22

3-
source ./.travis/lib-setup.sh
4-
source ./.travis/lib-deploy.sh
3+
source ./.ci/lib-setup.sh
4+
source ./.ci/lib-deploy.sh
55

66
# build again since I can't figure out how to get travis to recognize the old
77
# build in the new container. The other alternative (besides actually solving
88
# the issue) is to run the docs build and tarball generation every time.
99

10-
./.travis/build.sh
10+
./.ci/build.sh
1111

1212
setup::activate
1313

.travis/before-docs-deploy.sh renamed to .ci/before-docs-deploy.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/bin/bash -ex
22

3-
source ./.travis/lib-setup.sh
4-
source ./.travis/lib-deploy.sh
3+
source ./.ci/lib-setup.sh
4+
source ./.ci/lib-deploy.sh
55

66
# build again since I can't figure out how to get travis to recognize the old
77
# build in the new container. The other alternative (besides actually solving
88
# the issue) is to run the docs build and tarball generation every time.
99

10-
./.travis/build.sh
10+
./.ci/build.sh
1111

1212
setup::activate
1313

.travis/build.sh renamed to .ci/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash -ex
22

33
# set up dependencies, etc
4-
source ./.travis/lib-setup.sh
4+
source ./.ci/lib-setup.sh
55
setup::install
66

77
if [ x"$FLAKE" = "xyes" ]; then
File renamed without changes.
File renamed without changes.
File renamed without changes.

.travis/lib-setup.sh renamed to .ci/lib-setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ setup::macos::install() {
7878

7979
setup::windows::install() {
8080
# Install the right Python version and MIT Kerberos
81-
choco install python"${PYENV:0:1}" --version $PYENV
81+
choco install python"${PYENV:0:1}" --version $PYENV || true
8282
choco install mitkerberos --install-arguments "'ADDLOCAL=ALL'" || true
8383
PYPATH="/c/Python${PYENV:0:1}${PYENV:2:1}"
8484
# Update path to include them
File renamed without changes.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: deploy latest docs
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
# TODO: not sure if the original was meant to mean a branch named 'infra'
8+
# or any branch prefixed by 'infra/' ? The regex suggests it was the former
9+
# but why there was a regex instead of direct name comparison then ?
10+
- 'infra/**'
11+
12+
jobs:
13+
deploy-latest-docs:
14+
runs-on: ubuntu-latest
15+
name: 'deploy'
16+
env:
17+
DISTRO: 'fedora:latest'
18+
PYTHON: 3
19+
# WARNING: make sure this doesn't leak b/c IDK if GitHub logs will protect it
20+
# like Travis or not. Either way I don't think this line is necessary
21+
# b/c the variable should be globally available. For more info:
22+
# https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
25+
steps:
26+
- name: Check out code
27+
uses: actions/checkout@v2
28+
29+
- name: Deploy
30+
run: |
31+
./.ci/lib-util.sh
32+
util::docker-run $DISTRO ./.ci/before-docs-deploy.sh
33+
34+
./.ci/docs-deploy.sh travis_docs_build/html latest pythongssapi/python-gssapi

.github/workflows/run-on-linux.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash -ex
2+
#
3+
# We're using this script for running the test job b/c GitHub's parser
4+
# doesn't support yaml anchors originally used in .travis.yml, see:
5+
# https://github.community/t5/GitHub-Actions/Support-for-YAML-anchors/m-p/30336
6+
#
7+
8+
sudo sed -i '1i 127.0.0.1 test.box' /etc/hosts
9+
sudo hostname test.box
10+
source ./.ci/lib-util.sh
11+
util::docker-run $DISTRO ./.ci/build.sh

.github/workflows/testing.yml

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
name: testing
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: master
7+
8+
jobs:
9+
debian-stable-python-3:
10+
runs-on: ubuntu-latest
11+
name: 'debian:stable / Python 3'
12+
env:
13+
DISTRO: 'debian:stable'
14+
PYTHON: 3 # 3.7
15+
16+
steps:
17+
- name: Check out code
18+
uses: actions/checkout@v2
19+
20+
- name: Build and test gssapi
21+
run: |
22+
./.github/workflows/run-on-linux.sh
23+
24+
debian-stable-python-3-heimdal:
25+
runs-on: ubuntu-latest
26+
name: 'debian:stable / Python 3 / heimdal'
27+
env:
28+
DISTRO: 'debian:stable'
29+
PYTHON: 3
30+
KRB5_VER: heimdal
31+
32+
steps:
33+
- name: Check out code
34+
uses: actions/checkout@v2
35+
36+
- name: Build and test gssapi
37+
run: |
38+
./.github/workflows/run-on-linux.sh
39+
40+
centos-8-python-3:
41+
runs-on: ubuntu-latest
42+
name: 'centos:8 / Python 3'
43+
env:
44+
DISTRO: 'centos:8'
45+
PYTHON: 3
46+
47+
steps:
48+
- name: Check out code
49+
uses: actions/checkout@v2
50+
51+
- name: Build and test gssapi
52+
run: |
53+
./.github/workflows/run-on-linux.sh
54+
55+
fedora-latest-python-3-flake-yes:
56+
runs-on: ubuntu-latest
57+
name: 'fedora:latest / Python 3 / flake8'
58+
env:
59+
DISTRO: 'fedora:latest'
60+
PYTHON: 3
61+
FLAKE: yes
62+
63+
steps:
64+
- name: Check out code
65+
uses: actions/checkout@v2
66+
67+
- name: Build and test gssapi
68+
run: |
69+
./.github/workflows/run-on-linux.sh
70+
71+
macos-latest-python-3-heimdal:
72+
runs-on: macos-latest
73+
name: 'macos-latest / Python 3.6.3 / heimdal'
74+
env:
75+
PYTHON: 3
76+
PYENV: '3.6.3'
77+
KRB5_VER: heimdal
78+
79+
steps:
80+
- name: Check out code
81+
uses: actions/checkout@v2
82+
83+
- name: Build and test gssapi
84+
shell: bash
85+
run: |
86+
./.ci/build.sh
87+
88+
windows-latest-python-381:
89+
runs-on: windows-latest
90+
name: 'windows-latest / Python 3.8.1'
91+
env:
92+
PYTHON: 3
93+
PYENV: '3.8.1'
94+
TRAVIS_OS_NAME: windows
95+
96+
steps:
97+
- name: Check out code
98+
uses: actions/checkout@v2
99+
100+
- name: Build and test gssapi
101+
shell: bash
102+
run: |
103+
./.ci/build.sh
104+
105+
windows-latest-python-373:
106+
runs-on: windows-latest
107+
name: 'windows-latest / Python 3.7.3'
108+
env:
109+
PYTHON: 3
110+
PYENV: '3.7.3'
111+
TRAVIS_OS_NAME: windows
112+
113+
steps:
114+
- name: Check out code
115+
uses: actions/checkout@v2
116+
117+
- name: Build and test gssapi
118+
shell: bash
119+
run: |
120+
./.ci/build.sh
121+
122+
windows-latest-python-368:
123+
runs-on: windows-latest
124+
name: 'windows-latest / Python 3.6.8'
125+
env:
126+
PYTHON: 3
127+
PYENV: '3.6.8'
128+
TRAVIS_OS_NAME: windows
129+
130+
steps:
131+
- name: Check out code
132+
uses: actions/checkout@v2
133+
134+
- name: Build and test gssapi
135+
shell: bash
136+
run: |
137+
./.ci/build.sh

.travis.yml

Lines changed: 10 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -6,88 +6,35 @@ language: python
66
services:
77
- docker
88

9-
# we do everything in docker for non MacOS, MacOS setup is in .travis/build.sh
9+
# we do everything in docker for non MacOS, MacOS setup is in .ci/build.sh
1010
install: skip
1111
before_install: skip
1212

1313
stages:
14-
- test
15-
- name: deploy latest docs
16-
if: (branch = master OR branch =~ ^infra/$) AND type = push
1714
- name: deploy
1815
if: tag is PRESENT
1916

2017
script:
2118
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
2219
sudo sed -i '1i 127.0.0.1 test.box' /etc/hosts;
2320
sudo hostname test.box;
24-
source ./.travis/lib-util.sh;
25-
util::docker-run $DISTRO ./.travis/build.sh;
21+
source ./.ci/lib-util.sh;
22+
util::docker-run $DISTRO ./.ci/build.sh;
2623
fi
27-
- if [[ "$TRAVIS_OS_NAME" != "linux" ]]; then ./.travis/build.sh; fi
24+
- if [[ "$TRAVIS_OS_NAME" != "linux" ]]; then ./.ci/build.sh; fi
2825

2926
jobs:
3027
# need to explictly define each builder for test due to different os types
3128
include:
32-
- stage: test
33-
env: DISTRO=debian:stable PYTHON="3" # 3.7
34-
35-
- stage: test
36-
env: DISTRO=debian:stable PYTHON="3" KRB5_VER="heimdal"
37-
38-
# el7 doesn't do python3 modules, and epel7's python3-gssapi is patched
39-
- stage: test
40-
env: DISTRO=centos:8 PYTHON="3"
41-
42-
- stage: test
43-
env: DISTRO=fedora:latest PYTHON="3" FLAKE="yes"
44-
45-
# Travis defaults to 10.13 (i.e., not latest), so specify osx_image
46-
- &osx_test
47-
stage: test
48-
env: PYTHON="3" KRB5_VER="heimdal" PYENV="3.6.3"
49-
os: osx
50-
osx_image: xcode9.2
51-
language: generic # causes issues with pyenv installer when set to python
52-
53-
- &win_test
54-
stage: test
55-
env: PYTHON="3" PYENV="3.8.1"
56-
os: windows
57-
language: sh # Windows not supported yet
58-
59-
- <<: *win_test
60-
env: PYTHON="3" PYENV="3.7.3"
61-
62-
- <<: *win_test
63-
env: PYTHON="3" PYENV="3.6.8"
64-
65-
- stage: deploy latest docs
66-
script: skip
67-
env:
68-
- DISTRO=fedora:latest
69-
- PYTHON="3"
70-
- secure: L5SpEj5+no20PWwC9Y/XNhAfmUvYiuykwSMa/YyqvUuBjdizzpZcHr7Ego5nMdM1TniTxj4pSTM+GbM0FHCzNmAINSRh9g/D3hheRqlRBacqR0XwC9ZZRvkKvtzwnLh4vYWiauq4AoDeR5U6tkEcay6LjE57iMQcLjcKYBc+Eos=
71-
before_deploy:
72-
- source ./.travis/lib-util.sh
73-
- util::docker-run $DISTRO ./.travis/before-docs-deploy.sh
74-
75-
deploy:
76-
- provider: script
77-
script: .travis/docs-deploy.sh travis_docs_build/html latest pythongssapi/python-gssapi
78-
skip_cleanup: true
79-
on:
80-
all_branches: true
81-
8229
- stage: deploy
8330
script: skip
8431
env:
8532
- DISTRO=fedora:latest
8633
- PYTHON="3"
8734
- secure: L5SpEj5+no20PWwC9Y/XNhAfmUvYiuykwSMa/YyqvUuBjdizzpZcHr7Ego5nMdM1TniTxj4pSTM+GbM0FHCzNmAINSRh9g/D3hheRqlRBacqR0XwC9ZZRvkKvtzwnLh4vYWiauq4AoDeR5U6tkEcay6LjE57iMQcLjcKYBc+Eos=
8835
before_deploy:
89-
- source ./.travis/lib-util.sh
90-
- util::docker-run $DISTRO ./.travis/before-deploy.sh
36+
- source ./.ci/lib-util.sh
37+
- util::docker-run $DISTRO ./.ci/before-deploy.sh
9138
- ls -alR `pwd`
9239

9340
deploy:
@@ -109,11 +56,11 @@ jobs:
10956
docs_dir: travis_docs_build/html
11057
on:
11158
all_branches: true
112-
# NB(directxman12): this is a hack. Check ./.travis/before-deploy.sh for an explanation.
59+
# NB(directxman12): this is a hack. Check ./.ci/before-deploy.sh for an explanation.
11360
distributions: "check"
11461

11562
- provider: script
116-
script: .travis/docs-deploy.sh travis_docs_build/html stable pythongssapi/python-gssapi
63+
script: .ci/docs-deploy.sh travis_docs_build/html stable pythongssapi/python-gssapi
11764
skip_cleanup: true
11865
on:
11966
all_branches: true
@@ -122,8 +69,8 @@ jobs:
12269
stage: deploy
12370
os: windows
12471
script: # This is egregious hacks around Travis
125-
- ./.travis/before-deploy-windows-wheels.sh
126-
- ./.travis/deploy-win.sh
72+
- ./.ci/before-deploy-windows-wheels.sh
73+
- ./.ci/deploy-win.sh
12774
env:
12875
- PYTHON="3"
12976
- PYENV="3.8.1"

0 commit comments

Comments
 (0)