diff --git a/.github/workflows/apple-silicon.yml b/.github/workflows/apple-silicon.yml new file mode 100644 index 0000000..7dcc685 --- /dev/null +++ b/.github/workflows/apple-silicon.yml @@ -0,0 +1,27 @@ +name: Apple Silicon + +on: + push: + pull_request: + branches: [ main ] + schedule: + - cron: '0 0 * * *' + workflow_dispatch: + +jobs: + build: + runs-on: macos-latest + strategy: + matrix: + type: [Debug, Release] + steps: + - uses: actions/checkout@v4 + - name: Clone GTest + run: git clone https://github.com/google/googletest.git + - name: Build and run + run: | + cd $GITHUB_WORKSPACE + mkdir build && cd build + cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} ../ + make -j8 + ./cppTutorUT diff --git a/.github/workflows/x86-ubuntu.yml b/.github/workflows/x86-ubuntu.yml index ff1e98d..91c8624 100644 --- a/.github/workflows/x86-ubuntu.yml +++ b/.github/workflows/x86-ubuntu.yml @@ -1,20 +1,33 @@ name: x86-Ubuntu -on: [push] +on: + push: + pull_request: + branches: [ main ] + schedule: + - cron: '0 0 * * *' + workflow_dispatch: jobs: build: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 + strategy: + matrix: + compiler: + - { compiler: GNU, CC: gcc-10, CXX: g++-10 } + - { compiler: LLVM, CC: clang-10, CXX: clang++-10 } + type: [Debug, Release] steps: - - uses: actions/checkout@v1 - - name: Build cpp-tutor + - uses: actions/checkout@v4 + - name: Clone GTest + run: git clone https://github.com/google/googletest.git + - name: Build and run + env: + CC: ${{ matrix.compiler.CC }} + CXX: ${{ matrix.compiler.CXX }} run: | - # CLONE GTEST - git clone https://github.com/google/googletest.git - # BUILD CPP-TUTOR - mkdir build - cd build - cmake -DCMAKE_BUILD_TYPE=Release ../ + cd $GITHUB_WORKSPACE + mkdir build && cd build + cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} ../ make -j8 - # RUN UNIT TESTS ./cppTutorUT diff --git a/.github/workflows/x86-windows.yml b/.github/workflows/x86-windows.yml new file mode 100644 index 0000000..7364887 --- /dev/null +++ b/.github/workflows/x86-windows.yml @@ -0,0 +1,29 @@ +name: x86-Windows + +on: + push: + pull_request: + branches: [ main ] + schedule: + - cron: '0 0 * * *' + workflow_dispatch: + +jobs: + build: + runs-on: windows-latest + strategy: + matrix: + type: [Debug, Release] + steps: + - uses: actions/checkout@v4 + - name: Clone GTest + run: git clone https://github.com/google/googletest.git + - name: Build and run + run: | + cd $GITHUB_WORKSPACE + mkdir build + cmake -S . -B build/ -DCMAKE_BUILD_TYPE=${{ matrix.type }} ..\ + cmake --build . + cd .\build + ls + cppTutorUT diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 72ed4fa..0000000 --- a/.travis.yml +++ /dev/null @@ -1,40 +0,0 @@ -dist: Bionic -language: cpp - -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-7 - -matrix: - include: - - os: linux - env: - - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" - - os: linux - env: - # The version of clang available in Ubuntu Xenial is clang-7. There's a - # clang-7 symlink (that points to clang), so the version of the C - # compiler can be set with the CC env variable. However, there's no - # clang++-7 symlink, which means that it's impossible to use the CXX env - # variable to force the clang++ version. As a result, simply use system - # clang and clang++ binaries that are known to correspond to clang-7. - - MATRIX_EVAL="CC=clang && CXX=clang++" - - os: osx - osx_image: xcode10.1 - -before_install: -- eval "${MATRIX_EVAL}" - -script: - # CLONE GTEST - - git clone https://github.com/google/googletest.git - # BUILD CPP-TUTOR - - mkdir build - - cd build - - cmake -DCMAKE_BUILD_TYPE=Release ../ - - make -j8 - # RUN UNIT TESTS - - ./cppTutorUT diff --git a/README.md b/README.md index a143a6e..3eeba97 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ cpp-tutor ========= -[![Build Status](https://travis-ci.org/banach-space/cpp-tutor.svg?branch=master)](https://travis-ci.org/banach-space/cpp-tutor) -[![Build status](https://ci.appveyor.com/api/projects/status/axf91gjs67eoms4s/branch/add_appveyor?svg=true)](https://ci.appveyor.com/project/banach-space/cpp-tutor/branch/add_appveyor) -[![Build Status](https://github.com/banach-space/cpp-tutor/workflows/x86/badge.svg)](https://github.com/banach-space/cpp-tutor/actions?query=workflow%3Ax86) +[![Apple Silicon](https://github.com/banach-space/cpp-tutor/actions/workflows/apple-silicon.yml/badge.svg)](https://github.com/banach-space/cpp-tutor/actions/workflows/apple-silicon.yml) +[![x86-Ubuntu](https://github.com/banach-space/cpp-tutor/actions/workflows/x86-ubuntu.yml/badge.svg)](https://github.com/banach-space/cpp-tutor/actions/workflows/x86-ubuntu.yml) Code examples for tutoring modern C++. diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 6c154ed..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,44 +0,0 @@ -version: '1.0.{build}' - -platform: - - x64 - -clone_folder: c:\projects\cpp-tutor -image: -- Visual Studio 2017 - -configuration: - - Release - -environment: - matrix: - - arch: Win64 -matrix: - fast_finish: true - -init: -- set arch= -- if "%arch%"=="Win64" ( set arch= Win64) -- echo %arch% -- echo %APPVEYOR_BUILD_WORKER_IMAGE% -- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" ( set generator="Visual Studio 15 2017%arch%" ) -- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" ( set generator="Visual Studio 14 2015%arch%" ) -- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2013" ( set generator="Visual Studio 12 2013%arch%" ) -- echo %generator% - -before_build: -- cmd: |- - git clone https://github.com/google/googletest.git - mkdir _build - cd _build - cmake --version - cmake ../ -G %generator% - dir - -build: - project: $(APPVEYOR_BUILD_FOLDER)\_build\cpp-tutor.sln - verbosity: minimal - parallel: true - -test_script: - - '%APPVEYOR_BUILD_FOLDER%\_build\%CONFIGURATION%\cppTutorUT.exe'