Skip to content

Commit

Permalink
Common WF
Browse files Browse the repository at this point in the history
  • Loading branch information
nawaz1991 committed Dec 4, 2023
1 parent 7d6c725 commit b74a6b0
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 56 deletions.
52 changes: 26 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
name: build and test
on: [push, workflow_dispatch]

jobs:
job:
name: ${{ matrix.os }}-${{ github.workflow }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- name: Checkout cpp-oasvalidator
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- uses: lukka/get-cmake@latest

- name: Run CMake Ninja build all release preset including example, unittests, perftests
uses: lukka/run-cmake@v10
id: runcmake
with:
workflowPreset: 'release-all'
#name: build and test
#on: [push, workflow_dispatch]
#
#jobs:
# job:
# name: ${{ matrix.os }}-${{ github.workflow }}
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
#
# steps:
# - name: Checkout cpp-oasvalidator
# uses: actions/checkout@v4
# with:
# submodules: true
# fetch-depth: 0
#
# - uses: lukka/get-cmake@latest
#
# - name: Run CMake Ninja build all release preset including example, unittests, perftests
# uses: lukka/run-cmake@v10
# id: runcmake
# with:
# workflowPreset: 'release-all'
25 changes: 25 additions & 0 deletions .github/workflows/common-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Common Build and Test Steps
on:
workflow_call:
inputs:
os:
required: true
type: string

jobs:
build:
runs-on: ${{ inputs.os }}
steps:
- name: Checkout cpp-oasvalidator
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- uses: lukka/get-cmake@latest

- name: Run CMake Ninja build all release preset including example, unittests, perftests
uses: lukka/run-cmake@v10
id: runcmake
with:
workflowPreset: 'build-test-and-example'
8 changes: 8 additions & 0 deletions .github/workflows/linux-buil.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Ubuntu Build and Test
on: [push, workflow_dispatch]

jobs:
ubuntu-job:
uses: ./.github/workflows/common-build.yml
with:
os: ubuntu-latest
8 changes: 8 additions & 0 deletions .github/workflows/mac-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Mac Build and Test
on: [push, workflow_dispatch]

jobs:
ubuntu-job:
uses: ./.github/workflows/common-build.yml
with:
os: macos-latest
8 changes: 8 additions & 0 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Windows Build and Test
on: [push, workflow_dispatch]

jobs:
ubuntu-job:
uses: ./.github/workflows/common-build.yml
with:
os: windows-latest
42 changes: 19 additions & 23 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
{
"name": "release",
"displayName": "Release configuration for oasvalidator, tests and example",
"displayName": "Release configuration for oasvalidator, tests and example",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
Expand Down Expand Up @@ -86,26 +86,26 @@
],
"workflowPresets": [
{
"name": "debug-all",
"displayName": "Build oasvalidator, docs and code coverage",
"steps": [
{
"type": "configure",
"name": "debug"
},
{
"type": "build",
"name": "docs-build"
},
{
"type": "build",
"name": "codecov-build"
}
]
"name": "build-docs-and-codecov",
"displayName": "Build oasvalidator, docs and code coverage in Debug mode",
"steps": [
{
"type": "configure",
"name": "debug"
},
{
"type": "build",
"name": "docs-build"
},
{
"type": "build",
"name": "codecov-build"
}
]
},
{
"name": "release-all",
"displayName": "Build oasvalidator, docs and code coverage and run tests",
"name": "build-test-and-example",
"displayName": "Build oasvalidator, unittest, perftests and example in Release mode",
"steps": [
{
"type": "configure",
Expand All @@ -122,10 +122,6 @@
{
"type": "build",
"name": "tests-build"
},
{
"type": "test",
"name": "test-oasvalidator"
}
]
}
Expand Down
7 changes: 0 additions & 7 deletions vcpkg.json

This file was deleted.

0 comments on commit b74a6b0

Please sign in to comment.