Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👷 Run CI only when necessary #73

Merged
merged 6 commits into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/clang-tidy-review-post.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Post Clang-Tidy Review

on:
workflow_run:
workflows: [ "Clang-Tidy Review" ]
workflows: [ 'Clang-Tidy Review' ]
types:
- completed

Expand Down Expand Up @@ -39,4 +39,9 @@ jobs:

# Posts the comments
- name: Post review comments
id: post-review
uses: ZedThree/clang-tidy-review/post@v0.10.1

# If there are any comments, fail the check
- if: steps.post-review.outputs.total_comments > 0
run: exit 1
14 changes: 10 additions & 4 deletions .github/workflows/clang-tidy-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ jobs:
uses: ZedThree/clang-tidy-review@v0.10.1
id: review
with:
cmake_command: cmake . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DFICTION_CLI=ON -DFICTION_TEST=ON -DFICTION_EXPERIMENTS=ON -DMOCKTURTLE_EXAMPLES=OFF
cmake_command: >
cmake . -B build
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
-DFICTION_CLI=ON
-DFICTION_TEST=ON
-DFICTION_EXPERIMENTS=ON
-DMOCKTURTLE_EXAMPLES=OFF
build_dir: build
config_file: '.clang-tidy'
exclude: 'libs/*, docs/*, benchmarks/*, bib/*, */catch2/*.hpp'
Expand All @@ -26,16 +32,16 @@ jobs:
id: check-review-output
uses: andstor/file-existence-action@v2.0.0
with:
files: "clang-tidy-review-output.json"
files: 'clang-tidy-review-output.json'
ignore_case: true

# Workaround to fix an issue with non-existing review artifacts in the review posting workflow
- name: Create empty review artifact
if: steps.check-review-output.outputs.files_exists == 'false'
uses: finnp/create-file-action@1.0.0
env:
FILE_NAME: "clang-tidy-review-output.json"
FILE_DATA: "{}"
FILE_NAME: 'clang-tidy-review-output.json'
FILE_DATA: '{}'

- name: Upload review artifact
uses: actions/upload-artifact@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: "CodeQL"
name: CodeQL

on:
push:
branches: [ "main" ]
branches: [ 'main' ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
branches: [ 'main' ]
schedule:
- cron: '30 5 * * 6'

Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: "ccache-${{matrix.os}}-${{matrix.compiler}}-${{matrix.build_type}}"
key: '${{matrix.os}}-${{matrix.compiler}}-${{matrix.build_type}}'
variant: ccache
save: true
max-size: 10G
Expand All @@ -62,7 +62,18 @@ jobs:

- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: cmake ${{github.workspace}} -DCMAKE_CXX_COMPILER=${{matrix.compiler}} -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DFICTION_CLI=OFF -DFICTION_TEST=ON -DFICTION_Z3=ON -DFICTION_ENABLE_MUGEN=ON -DFICTION_PROGRESS_BARS=OFF -DMOCKTURTLE_EXAMPLES=OFF -DWARNINGS_AS_ERRORS=OFF -DENABLE_COVERAGE=ON
run: >
cmake ${{github.workspace}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler}}
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
-DFICTION_CLI=OFF
-DFICTION_TEST=ON
-DFICTION_Z3=ON
-DFICTION_ENABLE_MUGEN=ON
-DFICTION_PROGRESS_BARS=OFF
-DMOCKTURTLE_EXAMPLES=OFF
-DWARNINGS_AS_ERRORS=OFF
-DENABLE_COVERAGE=ON

- name: Build
working-directory: ${{github.workspace}}/build
Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,26 @@ name: Docker Image CI

on:
push:
branches: [ "main" ]
branches: [ 'main' ]
paths:
- '**.hpp'
- '**.cpp'
- 'libs/**'
- '.github/workflows/docker-image.yml'
pull_request:
branches: [ "main" ]
branches: [ 'main' ]
paths:
- '**.hpp'
- '**.cpp'
- 'libs/**'
- '.github/workflows/docker-image.yml'

jobs:

build:
name: Build Docker image
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build --build-arg NUMBER_OF_JOBS=2 . --file Dockerfile --tag fiction:$(date +%s)
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build --build-arg NUMBER_OF_JOBS=2 . --file Dockerfile --tag fiction:$(date +%s)
22 changes: 19 additions & 3 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: macOS CI

on: push
on:
push:
paths:
- '**.hpp'
- '**.cpp'
- 'libs/**'
- '.github/workflows/macos.yml'

defaults:
run:
Expand Down Expand Up @@ -55,7 +61,7 @@ jobs:
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: "ccache-${{matrix.os}}-${{matrix.compiler}}-${{matrix.build_type}}"
key: '${{matrix.os}}-${{matrix.compiler}}-${{matrix.build_type}}'
variant: ccache
save: true
max-size: 10G
Expand All @@ -75,7 +81,17 @@ jobs:

- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: cmake ${{github.workspace}} -DCMAKE_CXX_COMPILER=${{matrix.compiler}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DFICTION_CLI=ON -DFICTION_TEST=ON -DFICTION_EXPERIMENTS=ON -DFICTION_Z3=ON -DFICTION_PROGRESS_BARS=OFF -DMOCKTURTLE_EXAMPLES=OFF -DWARNINGS_AS_ERRORS=OFF
run: >
cmake ${{github.workspace}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler}}
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
-DFICTION_CLI=ON
-DFICTION_TEST=ON
-DFICTION_EXPERIMENTS=ON
-DFICTION_Z3=ON
-DFICTION_PROGRESS_BARS=OFF
-DMOCKTURTLE_EXAMPLES=OFF
-DWARNINGS_AS_ERRORS=OFF

- name: Build
working-directory: ${{github.workspace}}/build
Expand Down
23 changes: 20 additions & 3 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Ubuntu CI

on: push
on:
push:
paths:
- '**.hpp'
- '**.cpp'
- 'libs/**'
- '.github/workflows/ubuntu.yml'

defaults:
run:
Expand Down Expand Up @@ -46,7 +52,7 @@ jobs:
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: "ccache-${{matrix.os}}-${{matrix.compiler}}-${{matrix.build_type}}"
key: '${{matrix.os}}-${{matrix.compiler}}-${{matrix.build_type}}'
variant: ccache
save: true
max-size: 10G
Expand All @@ -71,7 +77,18 @@ jobs:

- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: cmake ${{github.workspace}} ${{matrix.cppstandard}} -DCMAKE_CXX_COMPILER=${{matrix.compiler}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DFICTION_CLI=ON -DFICTION_TEST=ON -DFICTION_EXPERIMENTS=ON -DFICTION_Z3=ON -DFICTION_ENABLE_MUGEN=ON -DFICTION_PROGRESS_BARS=OFF -DMOCKTURTLE_EXAMPLES=OFF -DWARNINGS_AS_ERRORS=OFF
run: >
cmake ${{github.workspace}} ${{matrix.cppstandard}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler}}
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
-DFICTION_CLI=ON
-DFICTION_TEST=ON
-DFICTION_EXPERIMENTS=ON
-DFICTION_Z3=ON
-DFICTION_ENABLE_MUGEN=ON
-DFICTION_PROGRESS_BARS=OFF
-DMOCKTURTLE_EXAMPLES=OFF
-DWARNINGS_AS_ERRORS=OFF

- name: Build fiction
working-directory: ${{github.workspace}}/build
Expand Down
24 changes: 19 additions & 5 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Windows CI

on: push
on:
push:
paths:
- '**.hpp'
- '**.cpp'
- 'libs/**'
- '.github/workflows/windows.yml'

defaults:
run:
Expand All @@ -18,9 +24,9 @@ jobs:
build_type: [ Debug, Release ]
include:
- os: windows-2019
env: "Visual Studio 16 2019"
env: 'Visual Studio 16 2019'
- os: windows-2022
env: "Visual Studio 17 2022"
env: 'Visual Studio 17 2022'
exclude:
- os: windows-2019
toolset: v143
Expand All @@ -39,7 +45,7 @@ jobs:
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: "ccache-${{matrix.os}}-${{matrix.toolset}}-${{matrix.build_type}}"
key: '${{matrix.os}}-${{matrix.toolset}}-${{matrix.build_type}}'
variant: ccache
save: true
max-size: 10G
Expand All @@ -59,7 +65,15 @@ jobs:

- name: Configure CMake
working-directory: ${{github.workspace}}\build
run: cmake ${{github.workspace}} -G "${{matrix.env}}" -A x64 -T ${{matrix.toolset}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DFICTION_CLI=ON -DFICTION_TEST=ON -DFICTION_EXPERIMENTS=ON -DFICTION_Z3=ON -DMOCKTURTLE_EXAMPLES=OFF -DWARNINGS_AS_ERRORS=OFF
run: >
cmake ${{github.workspace}} -G "${{matrix.env}}" -A x64 -T ${{matrix.toolset}}
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
-DFICTION_CLI=ON
-DFICTION_TEST=ON
-DFICTION_EXPERIMENTS=ON
-DFICTION_Z3=ON
-DMOCKTURTLE_EXAMPLES=OFF
-DWARNINGS_AS_ERRORS=OFF

- name: Build
working-directory: ${{github.workspace}}\build
Expand Down