diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index ca3d669d2..50b980dee 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -16,7 +16,7 @@ jobs: build-baseline: runs-on: ubuntu-latest container: - image: python:3.6.0 + image: python:3.8 steps: - uses: actions/checkout@v3 - name: Install dependencies @@ -49,10 +49,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up Python 3.11 + - name: Set up Python 3.12 uses: actions/setup-python@v4 with: - python-version: '3.11' + python-version: '3.12' cache: 'pip' - name: Install dependencies run: | diff --git a/Jenkinsfile b/Jenkinsfile index 9ab98f768..f9eb2c8a3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,11 +7,11 @@ pipeline { stages { stage('Test') { parallel { - stage('Test Python 3.6.0') { + stage('Test Python Baseline') { agent { dockerfile { dir 'src/tests' - filename 'python-360.Dockerfile' + filename 'python-baseline.Dockerfile' } } steps { @@ -20,17 +20,17 @@ pipeline { dir("tempsrc") { sh 'ls -la' } // Avoid git chowning .git/index to root which will cause the next build to fail // Work around old docker version in jenkins that can't change cwd: - sh 'cd tempsrc && ../src/tests/run_jenkins_tests.sh 3.6.0' + sh 'cd tempsrc && ../src/tests/run_jenkins_tests.sh baseline' dir("tempsrc") { deleteDir() } } - junit '3.6.0-results.xml' + junit 'baseline-results.xml' } } - stage('Test Python 3.7.0') { + stage('Test Python Latest') { agent { dockerfile { dir 'src/tests' - filename 'python-370.Dockerfile' + filename 'python-latest.Dockerfile' } } steps { @@ -39,17 +39,17 @@ pipeline { dir("tempsrc") { sh 'ls -la' } // Avoid git chowning .git/index to root which will cause the next build to fail // Work around old docker version in jenkins that can't change cwd: - sh 'cd tempsrc && ../src/tests/run_jenkins_tests.sh 3.7.0' + sh 'cd tempsrc && ../src/tests/run_jenkins_tests.sh latest' dir("tempsrc") { deleteDir() } } - junit '3.7.0-results.xml' + junit 'latest-results.xml' } } - stage('Test Python 3.8.0') { + stage('Test Ubuntu Baseline') { agent { dockerfile { dir 'src/tests' - filename 'python-380.Dockerfile' + filename 'ubuntu-baseline.Dockerfile' } } steps { @@ -58,17 +58,17 @@ pipeline { dir("tempsrc") { sh 'ls -la' } // Avoid git chowning .git/index to root which will cause the next build to fail // Work around old docker version in jenkins that can't change cwd: - sh 'cd tempsrc && ../src/tests/run_jenkins_tests.sh 3.8.0' + sh 'cd tempsrc && ../src/tests/run_jenkins_tests.sh ubuntu-baseline' dir("tempsrc") { deleteDir() } } - junit '3.8.0-results.xml' + junit 'ubuntu-baseline-results.xml' } } - stage('Test Python 3.9.0') { + stage('Test Ubuntu Latest') { agent { dockerfile { dir 'src/tests' - filename 'python-390.Dockerfile' + filename 'ubuntu-latest.Dockerfile' } } steps { @@ -77,48 +77,10 @@ pipeline { dir("tempsrc") { sh 'ls -la' } // Avoid git chowning .git/index to root which will cause the next build to fail // Work around old docker version in jenkins that can't change cwd: - sh 'cd tempsrc && ../src/tests/run_jenkins_tests.sh 3.9.0' + sh 'cd tempsrc && ../src/tests/run_jenkins_tests.sh ubuntu-latest' dir("tempsrc") { deleteDir() } } - junit '3.9.0-results.xml' - } - } - stage('Test Python RC') { - agent { - dockerfile { - dir 'src/tests' - filename 'python-rc.Dockerfile' - } - } - steps { - ansiColor(colorMapName: 'xterm') { - dir("tempsrc") { deleteDir() } - dir("tempsrc") { sh 'ls -la' } - // Avoid git chowning .git/index to root which will cause the next build to fail - // Work around old docker version in jenkins that can't change cwd: - sh 'cd tempsrc && ../src/tests/run_jenkins_tests.sh rc' - dir("tempsrc") { deleteDir() } - } - junit 'rc-results.xml' - } - } - stage('Test Ubuntu 18.04') { - agent { - dockerfile { - dir 'src/tests' - filename 'ubuntu.Dockerfile' - } - } - steps { - ansiColor(colorMapName: 'xterm') { - dir("tempsrc") { deleteDir() } - dir("tempsrc") { sh 'ls -la' } - // Avoid git chowning .git/index to root which will cause the next build to fail - // Work around old docker version in jenkins that can't change cwd: - sh 'cd tempsrc && ../src/tests/run_jenkins_tests.sh ubuntu' - dir("tempsrc") { deleteDir() } - } - junit 'ubuntu-results.xml' + junit 'ubuntu-latest-results.xml' } } } diff --git a/README.md b/README.md index e137c12dc..88439799a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# `cheribuild.py` - A script to build CHERI-related software (**requires Python 3.6+**) +# `cheribuild.py` - A script to build CHERI-related software (**requires Python 3.8+**) This script automates all the steps required to build various [CHERI](http://www.chericpu.com)-related software. For example `cheribuild.py [options] sdk-riscv64-purecap` will create an SDK that can be diff --git a/tests/python-370.Dockerfile b/tests/python-370.Dockerfile deleted file mode 100644 index 43c52d332..000000000 --- a/tests/python-370.Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM python:3.7.0 -LABEL maintainer="Alexander.Richardson@cl.cam.ac.uk" - -COPY requirements.txt /tmp/requirements.txt -RUN pip install -r /tmp/requirements.txt && rm -f /tmp/requirements.txt - -# setting Git username and email for workaround of -# https://github.com/jenkinsci/docker/issues/519 -ENV GIT_COMMITTER_NAME cheribuild -ENV GIT_COMMITTER_EMAIL cheribuild@cl.cam.ac.uk diff --git a/tests/python-390.Dockerfile b/tests/python-390.Dockerfile deleted file mode 100644 index 5dc69d25e..000000000 --- a/tests/python-390.Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM python:3.9.0 -LABEL maintainer="Alexander.Richardson@cl.cam.ac.uk" - -COPY requirements.txt /tmp/requirements.txt -RUN pip install -r /tmp/requirements.txt && rm -f /tmp/requirements.txt - -# setting Git username and email for workaround of -# https://github.com/jenkinsci/docker/issues/519 -ENV GIT_COMMITTER_NAME cheribuild -ENV GIT_COMMITTER_EMAIL cheribuild@cl.cam.ac.uk diff --git a/tests/python-380.Dockerfile b/tests/python-baseline.Dockerfile similarity index 100% rename from tests/python-380.Dockerfile rename to tests/python-baseline.Dockerfile diff --git a/tests/python-360.Dockerfile b/tests/python-latest.Dockerfile similarity index 94% rename from tests/python-360.Dockerfile rename to tests/python-latest.Dockerfile index e1fe8db53..c76e223d1 100644 --- a/tests/python-360.Dockerfile +++ b/tests/python-latest.Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.6.0 +FROM python:latest LABEL maintainer="Alexander.Richardson@cl.cam.ac.uk" diff --git a/tests/python-rc.Dockerfile b/tests/python-rc.Dockerfile deleted file mode 100644 index 16151b6eb..000000000 --- a/tests/python-rc.Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM python:rc - -LABEL maintainer="Alexander.Richardson@cl.cam.ac.uk" - -COPY requirements.txt /tmp/requirements.txt -RUN pip install -r /tmp/requirements.txt && rm -f /tmp/requirements.txt - -# setting Git username and email for workaround of -# https://github.com/jenkinsci/docker/issues/519 -ENV GIT_COMMITTER_NAME cheribuild -ENV GIT_COMMITTER_EMAIL cheribuild@cl.cam.ac.uk diff --git a/tests/run_jenkins_tests.sh b/tests/run_jenkins_tests.sh index 87b9d58fb..b554c8a2c 100755 --- a/tests/run_jenkins_tests.sh +++ b/tests/run_jenkins_tests.sh @@ -3,8 +3,8 @@ pytest_binary="python3 -m pytest" -case $1 in - 3.6.0|3.7.0|3.8.0|3.9.0|rc|ubuntu) +case $1 in + baseline|latest|ubuntu) test_prefix=$1 ;; *) diff --git a/tests/ubuntu.Dockerfile b/tests/ubuntu-baseline.Dockerfile similarity index 92% rename from tests/ubuntu.Dockerfile rename to tests/ubuntu-baseline.Dockerfile index c1cd60539..7f77f1a25 100644 --- a/tests/ubuntu.Dockerfile +++ b/tests/ubuntu-baseline.Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:bionic-20180426 +FROM ubuntu:20.04 LABEL maintainer="Alexander.Richardson@cl.cam.ac.uk" diff --git a/tests/ubuntu-latest.Dockerfile b/tests/ubuntu-latest.Dockerfile new file mode 100644 index 000000000..0f99c5350 --- /dev/null +++ b/tests/ubuntu-latest.Dockerfile @@ -0,0 +1,12 @@ +FROM ubuntu:latest + +LABEL maintainer="Alexander.Richardson@cl.cam.ac.uk" + +RUN apt-get update && apt-get install -y --no-install-recommends \ + make ninja-build \ + gcc \ + git \ + python3-minimal python3-pip python3-setuptools + +COPY requirements.txt /tmp/requirements.txt +RUN pip3 install -r /tmp/requirements.txt && rm -f /tmp/requirements.txt