Skip to content

Commit

Permalink
create 1 pipeline for each OS (#104)
Browse files Browse the repository at this point in the history
* [WIP] gcov add to debug

* update gcc debug cmake config

* [appveyor] upload coverage result to codecov

* [appveyor] fix upload gcov report gcc linux debug

* [appveyor] linux add lcov package

* [appveyor] fix add lcov pkg

* [azure-pipelines] sonarCloud refactor to run also on linux. Add gcov reports

* [azure-pipelines] fix #105

* [azure-pipelines] fix #105

* [azure-pipelines] fix #105

* [azure-pipelines] fix #105

* [azure-pipelines] fix #105

* [appveyor] fix

* [azure-pipelines] fix #105

* [appveyor] fix

* [azure-pipelines] fix #105

* [azure-pipelines] fix #105

* [azure-pipelines] fix #105

* [appveyor] fix

* [azure-pipelines] fix #105

* [appveyor] fix

* [azure-pipelines] fix #105

* [azure-pipelines] fix #105

* [appveyor] fix

* [azure-pipelines] fix #105

* [appveyor] fix

* [azure-pipelines] fix #105

* [appveyor] fix

* [azure-pipelines] fix #105

* [appveyor] fix

* [appveyor] [azure-pipelines] fix

* [azure-pipelines] fix #105

* [appveyor] [azure-pipelines] fix

* appveyor updatae

* [appveyor] [azure-pipelines] fix

* [WIP] :finnadie:

* [azure-pipelines] add mingw (GCC on windows)

* [azure-pipeline] refactor cmake gen and build steps

* [azure-pipelines] split by OS. fix #96

* update README

* [azure-pipelines|Analyzer] fix sonarcloud job

* [azure-pipelines] sonarcloud as a job in CI

* Revert "[azure-pipelines] sonarcloud as a job in CI"

This reverts commit d38ce67.

* [azure-pipelines] analyzer pipeline

* [azure-pipeline] [TEST] monolith Analyzer stage depends on Dep. comparison with new one

* [azure-pipeline] [TEST] [win|analyzer] trigger after ci pipeline complete

* [azure-pipelines] all in 1 renamed to monolithic pipeline

* [azure-pipelines] analyzer reverted to be triggered from GitHub

* [README] add analyzer pipeline badge

* update README

* Apply suggestions from code review
  • Loading branch information
Raffaello authored May 10, 2020
1 parent a23986b commit 79fdfc6
Show file tree
Hide file tree
Showing 13 changed files with 506 additions and 103 deletions.
53 changes: 47 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,33 @@

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/83e178fb7d9343b78be651f2797fe3f8)](https://app.codacy.com/manual/Raffaello/sdl2-vga-terminal?utm_source=github.com&utm_medium=referral&utm_content=Raffaello/sdl2-vga-terminal&utm_campaign=Badge_Grade_Settings)

| Windows (x86, x64) / Linux (x64) / macOS (x64) |
|------------------------------------------------|
|[![Build status](https://ci.appveyor.com/api/projects/status/67mildjynhnlekk5/branch/master?svg=true)](https://ci.appveyor.com/project/Raffaello/sdl2-vga-terminal/branch/master)|
|[![Build Status](https://dev.azure.com/raffaellobertini/sdl2-vga-terminal/_apis/build/status/Raffaello.sdl2-vga-terminal?branchName=master)](https://dev.azure.com/raffaellobertini/sdl2-vga-terminal/_build/latest?definitionId=4&branchName=master)|
| Monolithic CI | Note |
|:-------------:|-----:|
|[![Build status](https://ci.appveyor.com/api/projects/status/67mildjynhnlekk5/branch/master?svg=true)](https://ci.appveyor.com/project/Raffaello/sdl2-vga-terminal/branch/master)| secondary check|
|[![Build Status](https://dev.azure.com/raffaellobertini/sdl2-vga-terminal/_apis/build/status/Raffaello.sdl2-vga-terminal?branchName=master)](https://dev.azure.com/raffaellobertini/sdl2-vga-terminal/_build/latest?definitionId=4&branchName=master)| disabled|

| Linux (x64) | Windows (x86, x64) | macOS (x64) | Analyzer (WIN) |
|:-----------:|:------------------:|:-----------:|:--------------:|
|[![Build Status](https://dev.azure.com/raffaellobertini/sdl2-vga-terminal/_apis/build/status/Raffaello.sdl2-vga-terminal.Linux?branchName=master)](https://dev.azure.com/raffaellobertini/sdl2-vga-terminal/_build/latest?definitionId=6&branchName=master)|[![Build Status](https://dev.azure.com/raffaellobertini/sdl2-vga-terminal/_apis/build/status/Raffaello.sdl2-vga-terminal.Windows?branchName=master)](https://dev.azure.com/raffaellobertini/sdl2-vga-terminal/_build/latest?definitionId=7&branchName=master)|[![Build Status](https://dev.azure.com/raffaellobertini/sdl2-vga-terminal/_apis/build/status/Raffaello.sdl2-vga-terminal.MacOS?branchName=master)](https://dev.azure.com/raffaellobertini/sdl2-vga-terminal/_build/latest?definitionId=8&branchName=master)|[![Build Status](https://dev.azure.com/raffaellobertini/sdl2-vga-terminal/_apis/build/status/Raffaello.sdl2-vga-terminal.Analyzer?branchName=master)](https://dev.azure.com/raffaellobertini/sdl2-vga-terminal/_build/latest?definitionId=9&branchName=master)|

## SonarCloud

**NOTE:** Code Coverage is not yet computed

[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=Raffaello_sdl2-vga-terminal&metric=bugs)](https://sonarcloud.io/dashboard?id=Raffaello_sdl2-vga-terminal)
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=Raffaello_sdl2-vga-terminal&metric=code_smells)](https://sonarcloud.io/dashboard?id=Raffaello_sdl2-vga-terminal)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=Raffaello_sdl2-vga-terminal&metric=coverage)](https://sonarcloud.io/dashboard?id=Raffaello_sdl2-vga-terminal)
[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=Raffaello_sdl2-vga-terminal&metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=Raffaello_sdl2-vga-terminal)
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=Raffaello_sdl2-vga-terminal&metric=ncloc)](https://sonarcloud.io/dashboard?id=Raffaello_sdl2-vga-terminal)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=Raffaello_sdl2-vga-terminal&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=Raffaello_sdl2-vga-terminal)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Raffaello_sdl2-vga-terminal&metric=alert_status)](https://sonarcloud.io/dashboard?id=Raffaello_sdl2-vga-terminal)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=Raffaello_sdl2-vga-terminal&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=Raffaello_sdl2-vga-terminal)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=Raffaello_sdl2-vga-terminal&metric=security_rating)](https://sonarcloud.io/dashboard?id=Raffaello_sdl2-vga-terminal)
[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=Raffaello_sdl2-vga-terminal&metric=sqale_index)](https://sonarcloud.io/dashboard?id=Raffaello_sdl2-vga-terminal)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=Raffaello_sdl2-vga-terminal&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=Raffaello_sdl2-vga-terminal)


## Synopsis

It is just a VGA font terminal using SDL2.

Expand All @@ -17,15 +40,27 @@ It should be on 16 colors in the classic way, but can support more thanks to SDL

It is just a matter of fonts and a terminal grid for displaying texts.


## Requirements

- `SDL2`

## Compiling

Use `vcpkg` and install `SDL2`.

These are the requirements to compile the project from source:

- `cmake 3.16`
- `C++17`
- `vcpkg` for dependency management
- `gtest 1.10` for testing
- `SDL_Image` for snapshot testing

## Usage

SDL2 Video sub-system has to be initialized before using `VgaTerminal` class.

There are few examples usage as part of this cmake compilation too.
There are few examples too in `examples` folder.

## Screenshot

Expand All @@ -48,3 +83,9 @@ please note if you are dumping the snapshot, you have to copy back to the `test/
The filename generated are based on the test that are running, ideally: `[Test-suite.Test-name].png`

Just as a convention.


## Projects Idea to be done in the future

- `VgaTerminal Snake` (retro-gaming style snake in an emulated DOS Text mode)
- `VgaTerminal Tetris` (retro-gaming style Tetris in an emulated DOS Text Mode)
63 changes: 63 additions & 0 deletions azure-pipelines/analyzer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
trigger:
branches:
include:
- master
paths:
exclude:
#- .gitignore
- .github/*
- README.md
- appveyor.yml
tags:
include:
- '*'

pr:
branches:
include:
- master
paths:
exclude:
#- .gitignore
- .github/*
- README.md
- appveyor.yml
- LICENSE

variables:
- template: variables.yml

stages:
- stage: Dep
jobs:
- job: vcpkg
strategy:
matrix:
Win 64 bits:
imageName: ${{ variables.windows_image }}
TRIPLET: x64-windows
ARCH: 64
pool:
vmImage: $(imageName)
steps:
- template: templates/dep-vcpkg-steps.yml
parameters:
vcpkg_key_cache: $(CACHE_VCPKG_KEY)
triplet: $(TRIPLET)
arch: $(ARCH)

- stage: Analyzer
jobs:
- template: 'templates/sonarcloud-job.yml'
parameters:
imageName: ${{ variables.windows_image }}
jobName: SonarCloud_win
jobDisplayName: SonarCloud (WIN)
vcpkg_key_cache: $(CACHE_VCPKG_KEY)
triplet: x64-windows
arch: 64
build_type: Debug
sonar_wrapper_url: 'https://sonarcloud.io/static/cpp/build-wrapper-win-x86.zip'
build_wrapper: 'build-wrapper-win-x86\build-wrapper-win-x86-64.exe'
build_wrapper_path: build/build-wrapper-win-x86
cmake_ignore_path: $(CMAKE_IGNORE_PATH_WIN)
68 changes: 68 additions & 0 deletions azure-pipelines/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
trigger:
branches:
include:
- master
paths:
exclude:
#- .gitignore
- .github/*
- README.md
- appveyor.yml
tags:
include:
- '*'

pr:
branches:
include:
- master
paths:
exclude:
#- .gitignore
- .github/*
- README.md
- appveyor.yml
- LICENSE

variables:
- template: variables.yml

stages:
- stage: Dep
jobs:
- job: vcpkg
strategy:
matrix:
Linux:
imageName: ${{ variables.linux_image }}
TRIPLET: x64-linux
pool:
vmImage: $(imageName)
steps:
- template: templates/dep-vcpkg-steps.yml
parameters:
vcpkg_key_cache: $(CACHE_VCPKG_KEY)
triplet: $(TRIPLET)
arch: $(ARCH)

- stage: CI
jobs:
- job: Linux
variables:
TRIPLET: x64-linux
strategy:
matrix:
GCC Debug:
CONFIGURATION: Debug
GCC Release:
CONFIGURATION: Release
pool:
vmImage: ${{ variables.linux_image }}
steps:
- template: 'templates/ci-steps.yml'
parameters:
vcpkg_key_cache: $(CACHE_VCPKG_KEY)
triplet: $(TRIPLET)
build_type: $(CONFIGURATION)
test: false
install: false
67 changes: 67 additions & 0 deletions azure-pipelines/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
trigger:
branches:
include:
- master
paths:
exclude:
#- .gitignore
- .github/*
- README.md
- appveyor.yml
tags:
include:
- '*'

pr:
branches:
include:
- master
paths:
exclude:
#- .gitignore
- .github/*
- README.md
- appveyor.yml
- LICENSE

variables:
- template: variables.yml

stages:
- stage: Dep
jobs:
- job: vcpkg
strategy:
matrix:
MacOS:
imageName: ${{ variables.mac_image }}
TRIPLET: x64-osx
pool:
vmImage: $(imageName)
steps:
- template: templates/dep-vcpkg-steps.yml
parameters:
vcpkg_key_cache: $(CACHE_VCPKG_KEY)
triplet: $(TRIPLET)
arch: $(ARCH)

- stage: CI
jobs:
- job: macOS
variables:
TRIPLET: x64-osx
strategy:
matrix:
Debug:
CONFIGURATION: Debug
Release:
CONFIGURATION: Release
pool:
vmImage: ${{ variables.mac_image }}
steps:
- template: 'templates/ci-steps.yml'
parameters:
vcpkg_key_cache: $(CACHE_VCPKG_KEY)
triplet: $(TRIPLET)
build_type: $(CONFIGURATION)
install: false
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
### DISABLED ###

trigger:
branches:
include:
Expand Down Expand Up @@ -25,18 +27,7 @@ pr:
- LICENSE

variables:
CACHE_VCPKG_KEY: v3 | vcpkg-root
VCPKG_CMAKE: "$(Build.SourcesDirectory)/vcpkg/scripts/buildsystems/vcpkg.cmake"
#ARCH:
#TRIPLET:
#VCVARS:
SDL2_STATIC: ON
BUILD_TESTING: ON
BUILD_SHARED_LIBS: ON
BUILD_EXAMPLES: ON
BUiLD_SNAPSHOT: OFF
CMAKE_ARGS: -DWITH_SDL2_STATIC=$(SDL2_STATIC) -DBUILD_TESTING=$(BUILD_TESTING) -DBUILD_SHARED_LIBS=$(BUILD_SHARED_LIBS) -DBUILD_EXAMPLES=$(BUILD_EXAMPLES) -DBUILD_SNAPSHOT=$(BUILD_SNAPSHOT)
CMAKE_IGNORE_PATH_WIN: "C:/MinGW/bin;C:/Strawberry/c/bin;C:/Program Files (x86)/LLVM/bin;C:/ProgramData/chocolatey/bin"
- template: variables.yml

stages:
- stage: Dep
Expand All @@ -45,17 +36,17 @@ stages:
strategy:
matrix:
Linux:
imageName: 'ubuntu-16.04'
imageName: ${{ variables.linux_image }}
TRIPLET: x64-linux
MacOS:
imageName: 'macOS-10.15'
imageName: ${{ variables.mac_image }}
TRIPLET: x64-osx
Win 32 bits:
imageName: 'windows-2019'
imageName: ${{ variables.windows_image }}
TRIPLET: x86-windows
ARCH: 32
Win 64 bits:
imageName: 'windows-2019'
imageName: ${{ variables.windows_image }}
TRIPLET: x64-windows
ARCH: 64
pool:
Expand All @@ -79,9 +70,9 @@ stages:
GCC Release:
CONFIGURATION: Release
pool:
vmImage: 'ubuntu-18.04'
vmImage: ${{ variables.linux_image }}
steps:
- template: 'templates/ci-cmake-steps.yml'
- template: 'templates/ci-steps.yml'
parameters:
vcpkg_key_cache: $(CACHE_VCPKG_KEY)
triplet: $(TRIPLET)
Expand Down Expand Up @@ -112,9 +103,9 @@ stages:
CONFIGURATION: Release
TRIPLET: x86-windows
pool:
vmImage: 'windows-2019'
vmImage: ${{ variables.windows_image }}
steps:
- template: 'templates/ci-cmake-steps.yml'
- template: 'templates/ci-steps.yml'
parameters:
vcpkg_key_cache: $(CACHE_VCPKG_KEY)
triplet: $(TRIPLET)
Expand All @@ -132,22 +123,28 @@ stages:
Release:
CONFIGURATION: Release
pool:
vmImage: 'macOS-10.15'
vmImage: ${{ variables.mac_image }}
steps:
- template: 'templates/ci-cmake-steps.yml'
- template: 'templates/ci-steps.yml'
parameters:
vcpkg_key_cache: $(CACHE_VCPKG_KEY)
triplet: $(TRIPLET)
build_type: $(CONFIGURATION)
install: false

- stage: SonarCloud
jobs:
- stage: Analyzer
dependsOn: Dep
jobs:
- template: 'templates/sonarcloud-job.yml'
parameters:
imageName: ${{ variables.windows_image }}
jobName: SonarCloud_win
jobDisplayName: SonarCloud (WIN)
vcpkg_key_cache: $(CACHE_VCPKG_KEY)
triplet: x64-windows
arch: 64
build_type: Debug
sonar_wrapper_url: 'https://sonarcloud.io/static/cpp/build-wrapper-win-x86.zip'
build_wrapper: 'build-wrapper-win-x86\build-wrapper-win-x86-64.exe'
build_wrapper_path: build/build-wrapper-win-x86
cmake_ignore_path: $(CMAKE_IGNORE_PATH_WIN)
cmake_args: $(CMAKE_ARGS)
Loading

0 comments on commit 79fdfc6

Please sign in to comment.