Skip to content

Commit

Permalink
Creating github actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
james-moran-ea committed Feb 9, 2022
1 parent 543cc20 commit e045e9d
Showing 1 changed file with 132 additions and 0 deletions.
132 changes: 132 additions & 0 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: EASTL Build & Test Pipeline

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
checkout:
name: Checkout EASTL and submodules
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
path: EASTL/
- run: cd EASTL/ && git submodule update --init
- name: Upload checked out code
uses: actions/[email protected]
with:
name: Code
path: EASTL/

build:
needs: checkout

strategy:
fail-fast: false
matrix:
os: [ windows-latest, ubuntu-latest ]
compiler: [ clang, gcc, msvc ]
configuration: [ Debug, Release ]
exclude:
- os: windows-latest
compiler: gcc
- os: windows-latest
compiler: clang
- os: ubuntu-latest
compiler: msvc
include:
- os: windows-latest
compiler: msvc
cxxflags: '/std:c++20 /Zc:char8_t'
- os: ubuntu-latest
compiler: clang
cc: 'clang-11'
cxx: 'clang++-11'
cxxflags: '-std=c++20'
- os: ubuntu-latest
compiler: gcc
cc: 'gcc-10'
cxx: 'g++-10'
cxxflags: '-std=c++2a'

name: Build EASTL
runs-on: ${{ matrix.os }}

steps:
- name: Download a Build Artifact
uses: actions/[email protected]
with:
name: Code
path: Code/

- run: mkdir build
- run: cd build && cmake ../Code -DEASTL_BUILD_BENCHMARK:BOOL=ON -DEASTL_BUILD_TESTS:BOOL=ON
env:
CXXFLAGS: ${{ matrix.cxxflags }}
CXX: ${{ matrix.cxx }}
CC: ${{ matrix.cc }}
- run: cd build && cmake --build . --config ${{ matrix.configuration }}
- name: Upload binaries
uses: actions/[email protected]
with:
name: Binaries-${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.configuration }}
path: build/

test:
needs: build
name: Run EASTL tests
strategy:
fail-fast: false
matrix:
os: [ windows-latest, ubuntu-latest ]
compiler: [ clang, msvc, gcc ]
configuration: [ Debug, Release ]
exclude:
- os: windows-latest
compiler: gcc
- os: windows-latest
compiler: clang
- os: ubuntu-latest
compiler: msvc
runs-on: ${{ matrix.os }}

steps:
- name: Download a Build Artifact
uses: actions/[email protected]
with:
name: Binaries-${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.configuration }}
path: Binaries/
- if: matrix.os == 'ubuntu-latest'
run: chmod 755 ./Binaries/test/EASTLTest
- run: cd Binaries/test && ctest -C ${{ matrix.configuration }} -V

benchmark:
needs: build
name: Run EASTL benchmarks
strategy:
fail-fast: false
matrix:
os: [ windows-latest, ubuntu-latest ]
compiler: [ clang, msvc, gcc ]
configuration: [ Release ]
exclude:
- os: windows-latest
compiler: gcc
- os: windows-latest
compiler: clang
- os: ubuntu-latest
compiler: msvc
runs-on: ${{ matrix.os }}

steps:
- name: Download a Build Artifact
uses: actions/[email protected]
with:
name: Binaries-${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.configuration }}
path: Binaries/
- if: matrix.os == 'ubuntu-latest'
run: chmod 755 ./Binaries/benchmark/EASTLBenchmarks
- run: cd Binaries/benchmark && ctest -C ${{ matrix.configuration }} -V

0 comments on commit e045e9d

Please sign in to comment.