Skip to content

Ensure load after unload works #44

Ensure load after unload works

Ensure load after unload works #44

name: Docker Build and Test
on:
push:
branches:
- main
pull_request:
branches:
- main
### daily cron job to run the workflow
schedule:
- cron: '0 0 * * *' # Runs daily at midnight UTC
env:
ACR: jrtc
IMAGE_TAG: ${{ github.run_id }}-${{ github.sha }}
jobs:
build_and_test:
name: Build and Test
runs-on: ubuntu-latest
strategy:
matrix:
dockerType:
- { value: "azurelinux", displayName: "Azure Linux", id: "mariner" }
- { value: "ubuntu22_04", displayName: "Ubuntu 22.04", id: "ubuntu22_04" }
- { value: "ubuntu24_04", displayName: "Ubuntu 24.04", id: "ubuntu24_04" }
testCase:
- { description: "Address Sanitizer", id: "test1", sanitizerBuildParam: "-e SANITIZER=1" }
- { description: "No Address Sanitizer", id: "test2", sanitizerBuildParam: "-e SANITIZER=0" }
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: System Information
run: |
echo "****************Pipeline VM Information**********"
echo "Running on: ${{ runner.os }}"
echo "****************CPU Arch**********"
lscpu
echo "****************CPU***************"
cat /proc/cpuinfo
echo "****************MEM***************"
cat /proc/meminfo
echo "****************DISK**************"
df -h
echo "****************FREE**************"
free -m
echo "****************HOST**************"
echo "Agent.MachineName: ${{ runner.name }}"
echo "Agent.Name: ${{ github.actor }}"
echo "System.HostType: ${{ github.event_name }}"
if [ -z "${{ secrets.REQUIRED_CPU_MODEL }}" ]; then
echo "No specific CPU model required."
else
echo "Required CPU Model: ${{ secrets.REQUIRED_CPU_MODEL }}"
fi
echo "****************CPU Model*********"
lscpu
- name: Setup Docker
run: echo "Setting up Docker for ${{ matrix.dockerType.displayName }}"
- name: Build Docker Image
run: |
set -ex
./init_submodules.sh
docker build \
-t ${{ env.ACR }}/jrtc-${{ matrix.dockerType.id }}:${{ env.IMAGE_TAG }} \
-f deploy/${{ matrix.dockerType.value }}.Dockerfile .
docker tag ${{ env.ACR }}/jrtc-${{ matrix.dockerType.id }}:${{ env.IMAGE_TAG }} jrtc
- name: Run Container to Build JRTC
run: |
docker run \
-v "$(pwd)":/jrtc_out_lib \
-e INITIALIZE_SUBMODULES=0 \
${{ matrix.testCase.sanitizerBuildParam }} jrtc
- name: Run Tests
run: |
set -ex
source setup_jrtc_env.sh
docker run --init --privileged \
--ulimit memlock=-1 \
--network host \
--cap-add=SYS_ADMIN \
--shm-size=1g \
--mount type=tmpfs,destination=/dev/shm \
-e VERBOSE=1 \
-e JRTC_PATH=/jrtc \
-v "$(pwd)":/jrtc_out_lib \
${{ matrix.testCase.sanitizerBuildParam }} \
-e RUN_TESTS=1 jrtc
- name: Run Integration Tests
run: |
set -ex
source setup_jrtc_env.sh
docker run --init --privileged \
--ulimit memlock=-1 \
--network host \
--cap-add=SYS_ADMIN \
--shm-size=1g \
--mount type=tmpfs,destination=/dev/shm \
-e VERBOSE=1 \
-e JRTC_PATH=/jrtc \
-v /tmp:/tmp \
-v "$(pwd)":/jrtc_out_lib \
${{ matrix.testCase.sanitizerBuildParam }} \
--entrypoint=/jrtc/helper_build_files/run_all_integration_tests.sh \
jrtc