Skip to content

Commit a0c7202

Browse files
committed
ci: use preset workflow
1 parent 73f5647 commit a0c7202

File tree

11 files changed

+63
-83
lines changed

11 files changed

+63
-83
lines changed

.github/workflows/ci_cmake.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
name: ci_cmake
22

3-
env:
4-
CMAKE_BUILD_TYPE: Release
5-
63
on:
74
push:
85
paths:
9-
- "**/*.f90"
10-
- "**/*.cmake"
6+
- "**.f90"
7+
- "**.cmake"
118
- "**/CMakeLists.txt"
129
- ".github/workflows/ci_cmake.yml"
1310

@@ -16,9 +13,6 @@ jobs:
1613
linux:
1714
runs-on: ubuntu-latest
1815
steps:
19-
- uses: actions/checkout@v2
20-
21-
- run: cmake -B build
22-
- run: cmake --build build --parallel
16+
- uses: actions/checkout@v3
2317

24-
- run: ctest --test-dir build
18+
- run: cmake --workflow --preset default

.github/workflows/ci_meson.yml

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

.gitignore

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

CMakeLists.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
cmake_minimum_required(VERSION 3.15)
1+
cmake_minimum_required(VERSION 3.14)
22

33
project(mastermind
44
LANGUAGES Fortran
55
VERSION 1.4.0)
66

7-
include(CTest)
7+
enable_testing()
88

99
include(cmake/compilers.cmake)
1010

@@ -17,18 +17,12 @@ install(TARGETS mastermind)
1717

1818
# --- tests
1919

20-
if(BUILD_TESTING)
21-
2220
add_executable(compare_test test/test_compare.f90)
2321
target_link_libraries(compare_test PRIVATE game)
2422
add_test(NAME compare COMMAND compare_test)
25-
set_tests_properties(compare PROPERTIES TIMEOUT 10)
2623

2724
add_test(NAME Mastermind
2825
COMMAND ${CMAKE_COMMAND}
2926
-Dexe:FILEPATH=$<TARGET_FILE:mastermind>
3027
-Din_file:FILEPATH=${PROJECT_SOURCE_DIR}/test/cmd.log
3128
-P ${PROJECT_SOURCE_DIR}/test/test_mm.cmake)
32-
set_tests_properties(Mastermind PROPERTIES TIMEOUT 10)
33-
34-
endif(BUILD_TESTING)

CMakePresets.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"version": 6,
3+
4+
"configurePresets": [
5+
{
6+
"name": "default",
7+
"binaryDir": "${sourceDir}/build",
8+
"cacheVariables": {
9+
"CMAKE_COMPILE_WARNING_AS_ERROR": true
10+
}
11+
}
12+
],
13+
"buildPresets": [
14+
{
15+
"name": "default",
16+
"configurePreset": "default"
17+
}
18+
],
19+
"testPresets": [
20+
{
21+
"name": "default",
22+
"configurePreset": "default",
23+
"output": {
24+
"outputOnFailure": true,
25+
"verbosity": "verbose"
26+
},
27+
"execution": {
28+
"noTestsAction": "error",
29+
"scheduleRandom": true,
30+
"stopOnFailure": false,
31+
"timeout": 60
32+
}
33+
}
34+
],
35+
"workflowPresets": [
36+
{
37+
"name": "default",
38+
"steps": [
39+
{
40+
"type": "configure",
41+
"name": "default"
42+
},
43+
{
44+
"type": "build",
45+
"name": "default"
46+
},
47+
{
48+
"type": "test",
49+
"name": "default"
50+
}
51+
]
52+
}
53+
]
54+
}

LICENSE

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
Copyright 2021 Michael Hirsch
2-
31
Licensed under the Apache License, Version 2.0 (the "License");
42
you may not use this file except in compliance with the License.
53
You may obtain a copy of the License at

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# MasterMind Fortran game
22

3-
![Actions Status](https://github.com/fortran-gaming/mastermind/workflows/ci_meson/badge.svg)
43
![Actions Status](https://github.com/fortran-gaming/mastermind/workflows/ci_cmake/badge.svg)
54

65
This is the classic

app/mastermind.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ program mastermind
22
!! MasterMind in modern Fortran
33
!! https://en.wikipedia.org/wiki/Mastermind_%28board_game%29
44
!!
5-
!! Copyright 2010 Oz Nahum, 2018 Michael Hirsch, Ph.D.
5+
!! Copyright 2010 Oz Nahum, 2018 SciVision
66

77
use, intrinsic:: iso_fortran_env, only: stderr=>error_unit
88
use mm_game, only: getsecret, getguess, compare, reward, letters, getN

cmake/compilers.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
1+
if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
22
add_compile_options(-Wall -Wextra -Werror=array-bounds -fimplicit-none
33
$<$<CONFIG:Release>:-fno-backtrace>
44
"$<$<CONFIG:Debug>:-fcheck=all;-fexceptions;-ffpe-trap=invalid,zero,overflow;-finit-real=nan;-Wconversion>"

fpm.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
name = "mastermind"
22
version = "1.4.0"
3-
license = "Apache"
4-
author = "Michael Hirsch"
5-
copyright = "2020 Michael Hirsch"
63
keywords = ["games"]
74
homepage = "https://github.com/fortran-gaming/mastermind"

0 commit comments

Comments
 (0)