Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 115 additions & 0 deletions .github/workflows/aas-amd64-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: aas ci/cd main

on:
schedule:
- cron: '0 3 * * 6'
workflow_dispatch: {}
pull_request:
branches: [ "main" ]

jobs:
build-aircraft:
uses: ./.github/workflows/aircraft-amd64-build.yml

build-ground:
Comment thread Fixed
uses: ./.github/workflows/ground-amd64-build.yml

build-simulation:
Comment thread Fixed
uses: ./.github/workflows/simulation-amd64-build.yml

integration-test:
Comment thread Fixed
runs-on: ubuntu-22.04
needs: [build-aircraft, build-ground, build-simulation]
timeout-minutes: 120
permissions:
contents: read
packages: read
defaults:
run:
shell: bash -el {0}

steps:
- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet &
sudo rm -rf /usr/local/lib/android &
sudo rm -rf /opt/ghc &
sudo rm -rf /opt/hostedtoolcache/CodeQL &
sudo rm -rf /usr/local/share/boost &
sudo rm -rf /usr/share/swift &
sudo rm -rf "$AGENT_TOOLSDIRECTORY" &
wait
sudo docker image prune --all --force
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*

- name: Add swap space
run: |
sudo swapoff -a || true
sudo rm -f /swapfile
sudo fallocate -l 10G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

- name: Check swap
run: |
free -h
sudo swapon --show

- name: Check disk space
run: df -h

- name: Checkout the repository
uses: actions/checkout@v4

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Determine Docker tag
env:
EVENT_NAME: ${{ github.event_name }}
EVENT_NUMBER: ${{ github.event.number }}
REF_NAME: ${{ github.ref_name }}
REF: ${{ github.ref }}
run: |
if [ "$EVENT_NAME" == "pull_request" ]; then
echo "DOCKER_TAG=pr-${EVENT_NUMBER}" >> $GITHUB_ENV
elif [ "$REF" == "refs/heads/main" ]; then
echo "DOCKER_TAG=latest" >> $GITHUB_ENV
else
BRANCH_TAG=$(echo "$REF_NAME" | tr '/' '-')
echo "DOCKER_TAG=${BRANCH_TAG}" >> $GITHUB_ENV
fi

- name: Pull and verify images
run: |
echo "Pulling images with tag: ${{ env.DOCKER_TAG }}"
docker pull ghcr.io/jacopopan/aircraft-image:${{ env.DOCKER_TAG }}
docker pull ghcr.io/jacopopan/ground-image:${{ env.DOCKER_TAG }}
docker pull ghcr.io/jacopopan/simulation-image:${{ env.DOCKER_TAG }}
echo "Locally retagging the images as latest for aas_env.py"
docker tag ghcr.io/jacopopan/aircraft-image:${{ env.DOCKER_TAG }} aircraft-image:latest
docker tag ghcr.io/jacopopan/ground-image:${{ env.DOCKER_TAG }} ground-image:latest
docker tag ghcr.io/jacopopan/simulation-image:${{ env.DOCKER_TAG }} simulation-image:latest
docker images | grep latest

- name: Set up Conda with Python 3.13
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: aas
python-version: 3.13
auto-activate-base: false
use-only-tar-bz2: true

- name: Install aas-gym package
run: |
cd ./aas-gym/
pip install -e .

- name: Run aas-gym test
run: python3 ./scripts/gym_run.py --mode speedup --no-camera --no-lidar
26 changes: 19 additions & 7 deletions .github/workflows/aircraft-amd64-build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
name: aircraft-image amd64

on:
schedule:
- cron: '0 3 * * 6'
workflow_dispatch: {}
pull_request:
branches: [ "main" ]
workflow_call: {}

jobs:
build:
Expand Down Expand Up @@ -63,5 +59,21 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build the aircraft image (optionally, add --push)
run: docker buildx build -t ghcr.io/jacopopan/aircraft-image:latest -f ./scripts/docker/Dockerfile.aircraft .
- name: Determine Docker tag
env:
EVENT_NAME: ${{ github.event_name }}
EVENT_NUMBER: ${{ github.event.number }}
REF_NAME: ${{ github.ref_name }}
REF: ${{ github.ref }}
run: |
if [ "$EVENT_NAME" == "pull_request" ]; then
echo "DOCKER_TAG=pr-${EVENT_NUMBER}" >> $GITHUB_ENV
elif [ "$REF" == "refs/heads/main" ]; then
echo "DOCKER_TAG=latest" >> $GITHUB_ENV
else
BRANCH_TAG=$(echo "$REF_NAME" | tr '/' '-')
echo "DOCKER_TAG=${BRANCH_TAG}" >> $GITHUB_ENV
fi

- name: Build the aircraft
run: docker buildx build --push -t ghcr.io/jacopopan/aircraft-image:${{ env.DOCKER_TAG }} -f ./scripts/docker/Dockerfile.aircraft .
26 changes: 19 additions & 7 deletions .github/workflows/ground-amd64-build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
name: ground-image amd64

on:
schedule:
- cron: '0 3 * * 6'
workflow_dispatch: {}
pull_request:
branches: [ "main" ]
workflow_call: {}

jobs:
build:
Expand Down Expand Up @@ -63,5 +59,21 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build the ground image (optionally, add --push)
run: docker buildx build -t ghcr.io/jacopopan/ground-image:latest -f ./scripts/docker/Dockerfile.ground .
- name: Determine Docker tag
env:
EVENT_NAME: ${{ github.event_name }}
EVENT_NUMBER: ${{ github.event.number }}
REF_NAME: ${{ github.ref_name }}
REF: ${{ github.ref }}
run: |
if [ "$EVENT_NAME" == "pull_request" ]; then
echo "DOCKER_TAG=pr-${EVENT_NUMBER}" >> $GITHUB_ENV
elif [ "$REF" == "refs/heads/main" ]; then
echo "DOCKER_TAG=latest" >> $GITHUB_ENV
else
BRANCH_TAG=$(echo "$REF_NAME" | tr '/' '-')
echo "DOCKER_TAG=${BRANCH_TAG}" >> $GITHUB_ENV
fi

- name: Build the ground image
run: docker buildx build --push -t ghcr.io/jacopopan/ground-image:${{ env.DOCKER_TAG }} -f ./scripts/docker/Dockerfile.ground .
26 changes: 19 additions & 7 deletions .github/workflows/simulation-amd64-build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
name: simulation-image amd64

on:
schedule:
- cron: '0 3 * * 6'
workflow_dispatch: {}
pull_request:
branches: [ "main" ]
workflow_call: {}

jobs:
build:
Expand Down Expand Up @@ -63,5 +59,21 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build the simulation image (optionally, add --push)
run: docker buildx build -t ghcr.io/jacopopan/simulation-image:latest -f ./scripts/docker/Dockerfile.simulation .
- name: Determine Docker tag
env:
EVENT_NAME: ${{ github.event_name }}
EVENT_NUMBER: ${{ github.event.number }}
REF_NAME: ${{ github.ref_name }}
REF: ${{ github.ref }}
run: |
if [ "$EVENT_NAME" == "pull_request" ]; then
echo "DOCKER_TAG=pr-${EVENT_NUMBER}" >> $GITHUB_ENV
elif [ "$REF" == "refs/heads/main" ]; then
echo "DOCKER_TAG=latest" >> $GITHUB_ENV
else
BRANCH_TAG=$(echo "$REF_NAME" | tr '/' '-')
echo "DOCKER_TAG=${BRANCH_TAG}" >> $GITHUB_ENV
fi

- name: Build the simulation image
run: docker buildx build --push -t ghcr.io/jacopopan/simulation-image:${{ env.DOCKER_TAG }} -f ./scripts/docker/Dockerfile.simulation .
Loading