Skip to content

Commit d8fa111

Browse files
authored
GH workflow (#2)
* add github workflow * cleanup * Update README.md
1 parent 1403dd6 commit d8fa111

File tree

7 files changed

+70
-118
lines changed

7 files changed

+70
-118
lines changed

.c9build.sh

Lines changed: 0 additions & 53 deletions
This file was deleted.

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ jobs:
55
docker:
66
- image: circleci/python:2.7-stretch-browsers
77
environment:
8-
GTEST_ROOT: googletest-release-1.8.0/googletest
8+
GTEST_ROOT: googletest-release-1.8.1/googletest
99
steps:
1010
- checkout
1111
- run: sudo apt-get install cmake
1212
- run: "curl -fsSL https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin"
1313
- run: "testspace config url samples.testspace.com"
1414
- run: "sudo pip install gcovr"
15-
- run: "wget https://github.com/google/googletest/archive/release-1.8.0.zip"
16-
- run: "unzip release-1.8.0.zip"
15+
- run: "wget https://github.com/google/googletest/archive/release-1.8.1.zip"
16+
- run: "unzip release-1.8.1.zip"
1717
- run: "mkdir -p $GTEST_ROOT/build && cd $GTEST_ROOT/build && cmake -Dgtest_build_samples=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS_DEBUG='-g -fprofile-arcs -ftest-coverage' ../ && make clean gtest"
1818
- run: make -C $GTEST_ROOT/build |& tee build.log ; test ${PIPESTATUS[0]} -eq 0
1919
- run: $GTEST_ROOT/build/sample1_unittest --gtest_output=xml:sample1.xml

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Build
2+
on:
3+
push:
4+
schedule:
5+
- cron: '0 1 * * 0'
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-18.04
10+
env:
11+
GTEST_ROOT: googletest-release-1.8.1/googletest
12+
steps:
13+
- uses: actions/setup-python@v2
14+
with:
15+
python-version: 2.7
16+
- name: Setup build tools
17+
run: |
18+
sudo apt-get install cmake
19+
sudo pip install gcovr
20+
- uses: actions/checkout@v2
21+
with:
22+
fetch-depth: 50
23+
- uses: testspace-com/setup-testspace@v1
24+
with:
25+
domain: samples
26+
- name: Install GTest
27+
run: |
28+
wget https://github.com/google/googletest/archive/release-1.8.1.zip
29+
unzip release-1.8.1.zip
30+
mkdir -p $GTEST_ROOT/build
31+
pushd $GTEST_ROOT/build
32+
cmake -Dgtest_build_samples=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS_DEBUG='-g -fprofile-arcs -ftest-coverage' ../
33+
make clean gtest
34+
popd
35+
- name: Build
36+
run: |
37+
make -C $GTEST_ROOT/build |& tee build.log ; test ${PIPESTATUS[0]} -eq 0
38+
- name: Test
39+
run: |
40+
$GTEST_ROOT/build/sample1_unittest --gtest_output=xml:sample1.xml
41+
$GTEST_ROOT/build/sample2_unittest --gtest_output=xml:sample2.xml
42+
$GTEST_ROOT/build/sample3_unittest --gtest_output=xml:sample3.xml
43+
$GTEST_ROOT/build/sample4_unittest --gtest_output=xml:sample4.xml
44+
$GTEST_ROOT/build/sample5_unittest --gtest_output=xml:sample5.xml
45+
$GTEST_ROOT/build/sample6_unittest --gtest_output=xml:sample6.xml
46+
$GTEST_ROOT/build/sample7_unittest --gtest_output=xml:sample7.xml
47+
$GTEST_ROOT/build/sample8_unittest --gtest_output=xml:sample8.xml
48+
$GTEST_ROOT/build/sample9_unittest --gtest_output=xml:sample9.xml
49+
$GTEST_ROOT/build/sample10_unittest --gtest_output=xml:sample10.xml
50+
gcovr --root ./ --filter ".*/samples/.*" --exclude ".*_unittest.*" -x -o coverage.xml
51+
- name: Push
52+
run: |
53+
testspace build.log{lint} [Tests]sample*.xml coverage.xml
54+
if: always()

.gitignore

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
1-
# Ignore everything
2-
*
1+
googletest*
32

4-
# But not these files
5-
!.gitignore
6-
7-
!LICENSE
8-
!README.md
9-
10-
!.travis.yml
11-
!shippable.yml
12-
!.circleci/
13-
!.circleci/config.yml
14-
!.c9build.sh
15-
!.testspace.txt
3+
build.log
4+
.sample*.links/
5+
sample*.xml
6+
coverage.xml

.travis.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@ language:
33

44
env:
55
global:
6-
- GTEST_ROOT=$TRAVIS_BUILD_DIR/googletest-release-1.8.0/googletest
6+
- GTEST_ROOT=$TRAVIS_BUILD_DIR/googletest-release-1.8.1/googletest
77

88
before_install:
99
- mkdir -p $HOME/bin
1010
- curl -fsSL https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | tar -zxvf- -C $HOME/bin
1111
- testspace config url samples.testspace.com
1212
- testspace -v
1313
- pip install --user gcovr
14-
- wget https://github.com/google/googletest/archive/release-1.8.0.zip
15-
- unzip release-1.8.0.zip
14+
- wget https://github.com/google/googletest/archive/release-1.8.1.zip
15+
- unzip release-1.8.1.zip
1616
- mkdir -p $GTEST_ROOT/build
1717

1818
install:
1919
- pushd $GTEST_ROOT/build
2020
- cmake -Dgtest_build_samples=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS_DEBUG='-g -fprofile-arcs -ftest-coverage' ../
2121
- make clean gtest
2222
- popd
23-
23+
2424
script:
2525
- make -C $GTEST_ROOT/build |& tee build.log ; test ${PIPESTATUS[0]} -eq 0
2626
- $GTEST_ROOT/build/sample1_unittest --gtest_output=xml:sample1.xml
@@ -35,6 +35,5 @@ script:
3535
- $GTEST_ROOT/build/sample10_unittest --gtest_output=xml:sample10.xml
3636
- gcovr --root ./ --filter ".*/samples/.*" --exclude ".*_unittest.*" -x -o coverage.xml
3737

38-
# Requires TESTSPACE_TOKEN environment variable.
3938
after_script:
40-
- testspace build.log{lint} [Tests]sample*.xml coverage.xml
39+
- testspace build.log{lint} [Tests]sample*.xml coverage.xml

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44

55
## C++/Google Test sample for demonstrating Testspace
66

7-
Sample demonstrates techniques for using Testspace with C++ code and the [Google Test framework](https://code.google.com/p/googletest).
7+
Sample demonstrates techniques for using Testspace with C++ code and the [Google Test framework](https://github.com/google/googletest).
88
* Using a Testspace Project that is `connected` with this GitHub Repo
99
* Using 3 Online CI services for demonstration purposes only
1010
* Can review the Results at [testspace-samples:cpp.cpputest](https://samples.testspace.com/projects/testspace-samples:cpp.googletest)
11-
* Refer to our [Getting Started](https://help.testspace.com/getting-started) help articles for more information
11+
* Refer to our [Help](https://help.testspace.com/) for more information
1212

1313
***
1414
Using Multiple Online CI Services:
1515

16+
![Build](https://github.com/testspace-samples/cpp.googletest/workflows/Build/badge.svg)
1617
[![Build Status](https://travis-ci.org/testspace-samples/cpp.googletest.svg?branch=master)](https://travis-ci.org/testspace-samples/cpp.googletest)
1718
[![CircleCI](https://circleci.com/gh/testspace-samples/cpp.googletest.svg?style=svg)](https://circleci.com/gh/testspace-samples/cpp.googletest)
18-
[![Run Status](https://api.shippable.com/projects/570008739d043da07b099664/badge?branch=master)](https://app.shippable.com/projects/570008739d043da07b099664)
1919

2020

2121
***

shippable.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)