-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial version of system test container image, github workflow
- Loading branch information
Showing
7 changed files
with
99 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: System Tests | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
python-version: | ||
description: Python version | ||
required: true | ||
default: "3.11" | ||
type: string | ||
jobs: | ||
run-system-tests: | ||
runs-on: self-hosted | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
# Need this to get version number from last tag | ||
fetch-depth: 0 | ||
|
||
- if: inputs.python-version != 'dev' | ||
name: Install latest versions of python packages | ||
uses: ./.github/actions/install_requirements | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
pip-install: ".[dev]" | ||
|
||
- name: Run tests | ||
run: tox -e system-tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
FROM ubuntu:latest AS build | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
ARG RUNNER_VERSION="2.321.0" | ||
|
||
RUN apt update -y && apt upgrade -y && useradd -m docker | ||
RUN apt install -y \ | ||
curl | ||
|
||
RUN cd /home/docker && \ | ||
mkdir actions-runner && \ | ||
cd actions-runner && \ | ||
curl -o actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz\ | ||
-L https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz && \ | ||
tar xzf ./actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz | ||
|
||
# .NET 6 Linux package dependencies from | ||
# https://github.com/dotnet/core/blob/main/release-notes/6.0/linux-packages.md#ubuntu-2404-noble | ||
RUN apt-get install -y --no-install-recommends \ | ||
libc6 \ | ||
libgcc-s1 \ | ||
libicu74 \ | ||
libssl3 \ | ||
libstdc++6 \ | ||
zlib1g | ||
|
||
COPY start.sh /home/docker/actions-runner/start.sh | ||
|
||
RUN chown -R docker ~docker | ||
USER docker | ||
|
||
WORKDIR /home/docker/actions-runner | ||
ENTRYPOINT ["./start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
# Build the system test docker image | ||
podman build -f Dockerfile -t mx-bluesky-st |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
# Run the system test image locally | ||
# Set TOKEN to your API token before running | ||
# e.g. TOKEN=<my token> ./run.sh | ||
# to remove the runner | ||
# ./config remove | ||
podman run --secret actionsRunnerToken,type=env,target=TOKEN \ | ||
-i mx-bluesky-st:latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
./config.sh --url https://github.com/DiamondLightSource/mx-bluesky \ | ||
--name "mx-bluesky-system-test" \ | ||
--token ${TOKEN} \ | ||
--unattended | ||
|
||
cleanup() { | ||
echo "Removing runner.." | ||
./config.sh remove --token ${TOKEN} | ||
} | ||
|
||
trap 'cleanup; exit 130' INT | ||
trap 'cleanup; exit 143' TERM | ||
|
||
./run.sh & wait $! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters