-
Notifications
You must be signed in to change notification settings - Fork 653
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds a Container which holds the CCS and SDK so they can be used to build the various firmwares. The pipeline can be later expanded to also actually build the firmware(s). Signed-off-by: Olliver Schinagl <[email protected]>
- Loading branch information
Showing
5 changed files
with
236 additions
and
0 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,2 @@ | ||
* | ||
!container-entrypoint.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,78 @@ | ||
name: Create and publish Container image | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
android: true | ||
docker-images: true | ||
dotnet: true | ||
haskell: true | ||
large-packages: true | ||
swap-storage: true | ||
tool-cache: true | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=edge | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
flavor: | | ||
latest=auto | ||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: Containerfile | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
load: true |
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,68 @@ | ||
# SPDX-License-Identifier: MIT | ||
# | ||
# Copyright (C) 2024 Olliver Schinagl <[email protected]> | ||
|
||
ARG UBUNTU_VERSION="22.04" | ||
ARG TARGET_ARCH="library" | ||
|
||
FROM index.docker.io/${TARGET_ARCH}/ubuntu:${UBUNTU_VERSION} | ||
|
||
ENV HOME="/build" | ||
|
||
ARG SLF2_COMPONENTS="PF_CC2X" | ||
ENV SLF2_COMPONENTS="${SLF2_COMPONENTS}" | ||
|
||
ARG CCS_VERSION="12.5.0" | ||
ARG CCS_RELEASE="00007" | ||
ADD "https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-J1VdearkvK/${CCS_VERSION}/CCS${CCS_VERSION}.${CCS_RELEASE}_linux-x64.tar.gz" "/tmp/ccs_install/" | ||
ENV CCS_VERSION=${CCS_VERSION}.${CCS_RELEASE} | ||
|
||
RUN apt-get update && apt-get install --yes \ | ||
'tini' \ | ||
'build-essential' \ | ||
'cmake' \ | ||
'git' \ | ||
'libc6-i386' \ | ||
'libgconf-2-4' \ | ||
'libncurses5' \ | ||
'libtinfo5' \ | ||
'libusb-0.1-4' \ | ||
'python3' \ | ||
'unzip' \ | ||
&& \ | ||
rm -f -r '/var/cache/apt' && \ | ||
rm -f -r '/var/lib/apt' && \ | ||
echo 'Extracting CCS ...' && \ | ||
tar -xvf "/tmp/ccs_install/CCS${CCS_VERSION:?}_linux-x64.tar.gz" -C '/tmp/ccs_install' && \ | ||
echo 'Installing CCS ...' && \ | ||
"/tmp/ccs_install/CCS${CCS_VERSION}_linux-x64/ccs_setup_${CCS_VERSION}.run" \ | ||
--enable-components "${SLF2_COMPONENTS:?}" \ | ||
--mode unattended \ | ||
--prefix '/opt/ti/' \ | ||
&& \ | ||
echo 'Wrapping things up' && \ | ||
rm -f -r '/tmp/ccs_install' && \ | ||
ln -f -s \ | ||
'/opt/ti/xdctools_'*'_core' \ | ||
'/opt/ti/xdctools_core' \ | ||
&& \ | ||
ln -f -s \ | ||
'/opt/ti/ccs/utils/sysconfig_'* \ | ||
'/opt/ti/ccs/utils/sysconfig' \ | ||
&& \ | ||
ln -f -s \ | ||
'/opt/ti/ccs/tools/compiler/ti-cgt-armllvm_'* \ | ||
'/opt/ti/ccs/tools/compiler/ti-cgt-armllvm' \ | ||
&& \ | ||
echo 'Installation complete' | ||
|
||
ENV PATH="/opt/ti/ccs/eclipse:/opt/ti/ccs/utils/sysconfig/:${PATH}" | ||
ENV XDC_INSTALL_DIR="/opt/ti/xdctools_core" | ||
ENV SYSCONFIG_TOOL="sysconfig_cli.sh" | ||
ENV CMAKE="cmake" | ||
ENV PYTHON="python3" | ||
ENV TICLANG_ARMCOMPILER="/opt/ti/ccs/tools/compiler/ti-cgt-armllvm" | ||
|
||
COPY "container-entrypoint.sh" "/init" | ||
|
||
ENTRYPOINT [ "/usr/bin/tini", "--", "/init" ] |
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,27 @@ | ||
#!/bin/sh | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
# | ||
# Copyright (C) 2024 Olliver Schinagl <[email protected]> | ||
# | ||
# A beginning user should be able to docker run image bash (or sh) without | ||
# needing to learn about --entrypoint | ||
# https://github.com/docker-library/official-images#consistency | ||
|
||
set -eu | ||
if [ -n "${DEBUG_TRACE_SH:-}" ] && \ | ||
[ "${DEBUG_TRACE_SH:-}" != "${DEBUG_TRACE_SH#*"$(basename "${0}")"*}" ] || \ | ||
[ "${DEBUG_TRACE_SH:-}" = 'all' ]; then | ||
set -x | ||
fi | ||
|
||
bin='eclipse' | ||
|
||
# Prefix args with $bin if $1 is not a valid command | ||
if ! command -v -- "${1:-}" > '/dev/null' 2>&1; then | ||
# Always register the SDK on a valid command | ||
eclipse -noSplash -application com.ti.common.core.initialize -ccs.productDiscoveryPath "${SLF2_SDK}" | ||
set -- "${bin:?}" "${@}" | ||
fi | ||
exec "${@}" | ||
|
||
exit 0 |
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