Skip to content

Commit cd26186

Browse files
authored
GitHub actions (#8)
* Delete azure-pipelines.yml * Create CI.yml * Create CD.yml * Update .releaserc * Update README.md * Update CI.yml * Update CI.yml * Update CI.yml * Update CI.yml * Update CI.yml * Update CI.yml * Update CD.yml
1 parent 8a88c8b commit cd26186

File tree

5 files changed

+281
-143
lines changed

5 files changed

+281
-143
lines changed

.github/workflows/CD.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: CD
2+
3+
on:
4+
push:
5+
tags: 'v*'
6+
7+
jobs:
8+
release-ubuntu:
9+
runs-on: ubuntu-18.04
10+
11+
steps:
12+
- uses: actions/checkout@v1
13+
- uses: Geode-solutions/actions/get-release@master
14+
id: opengeode
15+
with:
16+
repository: OpenGeode
17+
file: '-Linux.tar.gz'
18+
token: ${{ secrets.TOKEN }}
19+
- name: Generate package
20+
id: package
21+
run: |
22+
sudo apt install doxygen
23+
mkdir -p build
24+
cd build
25+
version="${GITHUB_REF##*/*/}"
26+
echo ::set-output name=version::$version
27+
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH:PATH=${{ steps.opengeode.outputs.path }} -DMYMODULE_WITH_TESTS:BOOL=OFF -DCPACK_PACKAGE_VERSION:STRING=$version ..
28+
cmake --build . -- -j2
29+
cmake --build . --target package
30+
- name: Upload
31+
uses: softprops/action-gh-release@v1
32+
with:
33+
files: "build/MyModule-${{ steps.package.outputs.version }}-Linux.tar.gz"
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
- name: Doc
37+
run: curl -s https://raw.githubusercontent.com/Geode-solutions/actions/master/doc/doc.sh | bash -s -- ${GITHUB_WORKSPACE}/build
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.TOKEN }}
40+
41+
release-mac:
42+
runs-on: macOS-10.14
43+
44+
steps:
45+
- uses: actions/checkout@v1
46+
- uses: Geode-solutions/actions/get-release@master
47+
id: opengeode
48+
with:
49+
repository: OpenGeode
50+
file: '-Darwin.tar.gz'
51+
token: ${{ secrets.TOKEN }}
52+
- name: Generate package
53+
id: package
54+
run: |
55+
mkdir -p build
56+
cd build
57+
version="${GITHUB_REF##*/*/}"
58+
echo ::set-output name=version::$version
59+
cmake -G "Xcode" -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH:PATH=${{ steps.opengeode.outputs.path }} -DMYMODULE_WITH_TESTS:BOOL=OFF -DCPACK_PACKAGE_VERSION:STRING=$version ..
60+
cmake --build . --config Release
61+
cmake --build . --target package --config Release
62+
- name: Upload
63+
uses: softprops/action-gh-release@v1
64+
with:
65+
files: "build/MyModule-${{ steps.package.outputs.version }}-Darwin.tar.gz"
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
69+
release-windows:
70+
runs-on: windows-2016
71+
72+
steps:
73+
- uses: actions/checkout@v1
74+
- uses: Geode-solutions/actions/get-release@master
75+
id: opengeode
76+
with:
77+
repository: OpenGeode
78+
file: '-win64.zip'
79+
token: ${{ secrets.TOKEN }}
80+
- name: Generate package
81+
id: package
82+
run: |
83+
mkdir -p build
84+
cd build
85+
version="${GITHUB_REF##*/*/}"
86+
echo ::set-output name=version::$version
87+
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_PREFIX_PATH:PATH=${{ steps.opengeode.outputs.path }} -DMYMODULE_WITH_TESTS:BOOL=OFF -DCPACK_PACKAGE_VERSION:STRING=$version ..
88+
cmake --build . --config Release
89+
cmake --build . --target PACKAGE --config Release
90+
shell: bash
91+
- name: Upload
92+
uses: softprops/action-gh-release@v1
93+
with:
94+
files: "build/MyModule-${{ steps.package.outputs.version }}-win64.zip"
95+
env:
96+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/CI.yml

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: 0 0 * * *
8+
9+
jobs:
10+
format:
11+
runs-on: ubuntu-18.04
12+
13+
steps:
14+
- uses: actions/checkout@v1
15+
- uses: Geode-solutions/actions/clang-format@master
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.TOKEN }}
18+
19+
build-ubuntu:
20+
runs-on: ubuntu-18.04
21+
needs: format
22+
strategy:
23+
matrix:
24+
cc: [gcc, clang]
25+
cxx: [g++, clang++]
26+
config: [Debug, Release]
27+
exclude:
28+
- cc: gcc
29+
cxx: clang++
30+
- cc: clang
31+
cxx: g++
32+
33+
steps:
34+
- uses: actions/checkout@v1
35+
- uses: Geode-solutions/actions/get-release@master
36+
id: opengeode
37+
with:
38+
repository: OpenGeode
39+
file: '-Linux.tar.gz'
40+
token: ${{ secrets.TOKEN }}
41+
- name: Compile
42+
run: |
43+
mkdir -p build
44+
cd build
45+
cmake -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_PREFIX_PATH:PATH=${{ steps.opengeode.outputs.path }} ..
46+
cmake --build . -- -j2
47+
env:
48+
CC: ${{ matrix.cc }}
49+
CXX: ${{ matrix.cxx }}
50+
- name: Test
51+
run: |
52+
mkdir -p test
53+
cd test
54+
cmake -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_PREFIX_PATH:PATH="$GITHUB_WORKSPACE/build;$GITHUB_WORKSPACE/${{ steps.opengeode.outputs.path }}" ../tests
55+
cmake --build . -- -j2
56+
ctest --output-on-failure
57+
env:
58+
CC: ${{ matrix.cc }}
59+
CXX: ${{ matrix.cxx }}
60+
- name: Kcov
61+
run: curl -s https://raw.githubusercontent.com/Geode-solutions/actions/master/kcov.sh | bash -s -- ${GITHUB_WORKSPACE}/build/bin
62+
if: matrix.cc == 'gcc' && (github.event_name == 'pull_request' || github.ref == 'refs/heads/master') && matrix.config == 'Debug'
63+
- uses: codecov/codecov-action@v1.0.2
64+
if: matrix.cc == 'gcc' && (github.event_name == 'pull_request' || github.ref == 'refs/heads/master') && matrix.config == 'Debug'
65+
with:
66+
token: ${{ secrets.CODECOV_TOKEN }}
67+
file: kcov/kcov-merged/cobertura.xml
68+
- name: Notify slack
69+
if: failure() && github.ref == 'refs/heads/master'
70+
uses: 8398a7/action-slack@v2
71+
with:
72+
status: failure
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
76+
77+
build-mac:
78+
runs-on: macOS-10.14
79+
needs: format
80+
strategy:
81+
matrix:
82+
config: [Debug, Release]
83+
84+
steps:
85+
- uses: actions/checkout@v1
86+
- uses: Geode-solutions/actions/get-release@master
87+
id: opengeode
88+
with:
89+
repository: OpenGeode
90+
file: '-Darwin.tar.gz'
91+
token: ${{ secrets.TOKEN }}
92+
- name: Compile & Test
93+
run: |
94+
mkdir -p build
95+
cd build
96+
cmake -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_PREFIX_PATH:PATH=${{ steps.opengeode.outputs.path }} ..
97+
cmake --build .
98+
ctest --output-on-failure
99+
- name: Notify slack
100+
if: failure() && github.ref == 'refs/heads/master'
101+
uses: 8398a7/action-slack@v2
102+
with:
103+
status: failure
104+
env:
105+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
106+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
107+
108+
build-mac-xcode:
109+
runs-on: macOS-10.14
110+
needs: format
111+
strategy:
112+
matrix:
113+
config: [Debug, Release]
114+
115+
steps:
116+
- uses: actions/checkout@v1
117+
- uses: Geode-solutions/actions/get-release@master
118+
id: opengeode
119+
with:
120+
repository: OpenGeode
121+
file: '-Darwin.tar.gz'
122+
token: ${{ secrets.TOKEN }}
123+
- name: Compile & Test
124+
run: |
125+
mkdir -p build
126+
cd build
127+
cmake -G "Xcode" -DCMAKE_PREFIX_PATH:PATH=${{ steps.opengeode.outputs.path }} ..
128+
cmake --build . --config ${{ matrix.config }}
129+
ctest -C ${{ matrix.config }} --output-on-failure
130+
- name: Notify slack
131+
if: failure() && github.ref == 'refs/heads/master'
132+
uses: 8398a7/action-slack@v2
133+
with:
134+
status: failure
135+
env:
136+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
137+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
138+
139+
build-windows:
140+
runs-on: windows-2016
141+
needs: format
142+
strategy:
143+
matrix:
144+
config: [Debug, Release]
145+
146+
steps:
147+
- uses: actions/checkout@v1
148+
- uses: Geode-solutions/actions/get-release@master
149+
id: opengeode
150+
with:
151+
repository: OpenGeode
152+
file: '-win64.zip'
153+
token: ${{ secrets.TOKEN }}
154+
- name: Compile & Test
155+
run: |
156+
mkdir -p build
157+
cd build
158+
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_PREFIX_PATH:PATH=${{ steps.opengeode.outputs.path }} ..
159+
cmake --build . --config ${{ matrix.config }}
160+
ctest -C ${{ matrix.config }} --output-on-failure
161+
- name: Notify slack
162+
if: failure() && github.ref == 'refs/heads/master'
163+
uses: 8398a7/action-slack@v2
164+
with:
165+
status: failure
166+
env:
167+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
168+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
169+
170+
semantic-release:
171+
runs-on: ubuntu-18.04
172+
needs: [build-ubuntu, build-mac, build-mac-xcode, build-windows]
173+
steps:
174+
- uses: actions/checkout@v1
175+
- run: npx semantic-release
176+
env:
177+
GITHUB_TOKEN: ${{ secrets.TOKEN }}

.releaserc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"plugins": [
33
'@semantic-release/commit-analyzer',
44
'@semantic-release/release-notes-generator',
5-
'@semantic-release/github',
6-
'semantic-release-ado'
5+
'@semantic-release/github'
76
]
87
}

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
<h1 align="center">OpenGeode-ModuleTemplate<sup><i>by Geode-solutions</i></sup></h1>
22
<h3 align="center">Template for creating your own OpenGeode modules</h3>
33

4+
45
<p align="center">
5-
<img src="https://dev.azure.com/GeodeSolutions/Geode/_apis/build/status/Geode-solutions.OpenGeode-ModuleTemplate?branchName=master" alt="Build Status">
6-
<img src="https://img.shields.io/azure-devops/tests/GeodeSolutions/Geode/10/master.svg?compact_message" alt="Test Status">
7-
<img src="https://img.shields.io/azure-devops/coverage/GeodeSolutions/Geode/10/master.svg" alt="Coverage Status">
6+
<img src="https://github.com/Geode-solutions/OpenGeode-ModuleTemplate/workflows/CI/badge.svg" alt="Build Status">
7+
<img src="https://github.com/Geode-solutions/OpenGeode-ModuleTemplate/workflows/CD/badge.svg" alt="Deploy Status">
8+
<img src="https://codecov.io/gh/Geode-solutions/OpenGeode-ModuleTemplate/branch/master/graph/badge.svg" alt="Coverage Status">
89
<img src="https://img.shields.io/github/release/Geode-solutions/OpenGeode-ModuleTemplate.svg" alt="Version">
910
</p>
1011

1112
<p align="center">
12-
<img src="https://dev.azure.com/GeodeSolutions/Geode/_apis/build/status/Geode-solutions.OpenGeode-ModuleTemplate?branchName=master&jobName=Test_Windows&label=Windows" alt="Windows Build Status">
13-
<img src="https://dev.azure.com/GeodeSolutions/Geode/_apis/build/status/Geode-solutions.OpenGeode-ModuleTemplate?branchName=master&jobName=Test_Ubuntu&label=Linux" alt="Linux Build Status">
14-
<img src="https://dev.azure.com/GeodeSolutions/Geode/_apis/build/status/Geode-solutions.OpenGeode-ModuleTemplate?branchName=master&jobName=Test_Mac&label=macOS" alt="Apple Build Status">
13+
<img src="https://img.shields.io/static/v1?label=Windows&logo=windows&logoColor=white&message=support&color=success" alt="Windows support">
14+
<img src="https://img.shields.io/static/v1?label=Linux&logo=linux&logoColor=white&message=support&color=success" alt="Linux support">
15+
<img src="https://img.shields.io/static/v1?label=macOS&logo=apple&logoColor=white&message=support&color=success" alt="macOS support">
1516
</p>
1617

1718
<p align="center">

0 commit comments

Comments
 (0)