mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
ci: let ubuntu version be configurable
This commit is contained in:
21
.github/integration-test.py
vendored
21
.github/integration-test.py
vendored
@@ -4,15 +4,16 @@ import subprocess
|
||||
import os
|
||||
|
||||
|
||||
def build_systemd_image(image_name, source_path):
|
||||
def build_systemd_image(image_name, source_path, build_args=None):
|
||||
"""
|
||||
Build docker image with systemd at source_path.
|
||||
|
||||
Built image is tagged with image_name
|
||||
"""
|
||||
subprocess.check_call([
|
||||
'docker', 'build', '-t', image_name, source_path
|
||||
])
|
||||
cmd = ['docker', 'build', '-t', image_name, source_path]
|
||||
if build_args:
|
||||
cmd.extend([f"--build-arg={ba}" for ba in build_args])
|
||||
subprocess.check_call(cmd)
|
||||
|
||||
|
||||
def run_systemd_image(image_name, container_name, bootstrap_pip_spec):
|
||||
@@ -138,13 +139,21 @@ def main():
|
||||
argparser = argparse.ArgumentParser()
|
||||
subparsers = argparser.add_subparsers(dest='action')
|
||||
|
||||
subparsers.add_parser('build-image')
|
||||
build_image_parser = subparsers.add_parser('build-image')
|
||||
build_image_parser.add_argument(
|
||||
"--build-arg",
|
||||
action="append",
|
||||
dest="build_args",
|
||||
)
|
||||
|
||||
subparsers.add_parser('stop-container').add_argument(
|
||||
'container_name'
|
||||
)
|
||||
|
||||
subparsers.add_parser('start-container').add_argument(
|
||||
'container_name'
|
||||
)
|
||||
|
||||
run_parser = subparsers.add_parser('run')
|
||||
run_parser.add_argument('container_name')
|
||||
run_parser.add_argument('command')
|
||||
@@ -181,7 +190,7 @@ def main():
|
||||
elif args.action == 'stop-container':
|
||||
stop_container(args.container_name)
|
||||
elif args.action == 'build-image':
|
||||
build_systemd_image(image_name, 'integration-tests')
|
||||
build_systemd_image(image_name, 'integration-tests', args.build_args)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
10
.github/workflows/integration-test.yaml
vendored
10
.github/workflows/integration-test.yaml
vendored
@@ -60,22 +60,22 @@ jobs:
|
||||
env:
|
||||
matrix_include_pre_filter: |
|
||||
- name: "Int. tests: Ubuntu 18.04, Py 3.6"
|
||||
runs_on: ubuntu-18.04
|
||||
ubuntu_version: 18.04
|
||||
python_version: 3.6
|
||||
extra_flags: ""
|
||||
- name: "Int. tests: Ubuntu 20.04, Py 3.9"
|
||||
runs_on: ubuntu-20.04
|
||||
ubuntu_version: 20.04
|
||||
python_version: 3.9
|
||||
extra_flags: ""
|
||||
- name: "Int. tests: Ubuntu 20.04, Py 3.9, --upgrade"
|
||||
runs_on: ubuntu-20.04
|
||||
ubuntu_version: 20.04
|
||||
python_version: 3.9
|
||||
extra_flags: --upgrade
|
||||
dont_run_on_ref: refs/heads/master
|
||||
|
||||
integration-tests:
|
||||
needs: decide-on-test-jobs-to-run
|
||||
runs-on: ${{ matrix.runs_on }}
|
||||
runs-on: ubuntu-${{ matrix.ubuntu_version }}
|
||||
|
||||
name: ${{ matrix.name }}
|
||||
strategy:
|
||||
@@ -95,7 +95,7 @@ jobs:
|
||||
|
||||
- name: Build systemd image
|
||||
run: |
|
||||
.github/integration-test.py build-image
|
||||
.github/integration-test.py build-image --build-arg ubuntu_version=${{ matrix.ubuntu_version }}
|
||||
|
||||
- name: Run bootstrap checks
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user