Skip to content

Commit

Permalink
Create travis.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
justdesewa authored Dec 10, 2024
1 parent 445c6e3 commit 3ac26b7
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build and Deploy

on:
push:
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
cc: [gcc-12, clang-14] # Use supported versions available in Ubuntu repositories.

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y software-properties-common
# Install compilers based on the matrix
if [[ "${{ matrix.cc }}" == "gcc-12" ]]; then
sudo apt-get install -y g++-12
export CC=gcc-12
export CXX=g++-12
elif [[ "${{ matrix.cc }}" == "clang-14" ]]; then
sudo apt-get install -y clang-14 libc++-14-dev libc++abi-14-dev
export CC=clang-14
export CXX=clang++-14
fi
# Install CMake
sudo apt-get install -y cmake
- name: Configure with CMake
run: |
mkdir build
cd build
cmake ..
- name: Build project
run: |
cd build
make
- name: Archive artifacts
run: |
mkdir -p artifacts/lib artifacts/include/sydevs/core artifacts/include/sydevs/systems artifacts/include/sydevs/time
if [[ -d src/sydevs/core ]]; then
cp src/sydevs/core/*.h artifacts/include/sydevs/core || true
fi
if [[ -d src/sydevs/systems ]]; then
cp src/sydevs/systems/*.h artifacts/include/sydevs/systems || true
fi
if [[ -d src/sydevs/time ]]; then
cp src/sydevs/time/*.h artifacts/include/sydevs/time || true
fi
zip -r artifacts.zip artifacts

0 comments on commit 3ac26b7

Please sign in to comment.