Skip to content

Commit adc976b

Browse files
authored
Merge pull request #874 from su2code/release_automation
Adding change version action and making regression build fail on warning
2 parents 7141b3a + ef18ccc commit adc976b

File tree

8 files changed

+80
-24
lines changed

8 files changed

+80
-24
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Change Version
2+
3+
on:
4+
create:
5+
branches:
6+
- 'release_v*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@master
13+
- name: Extract branch name
14+
shell: bash
15+
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})"
16+
id: extract_branch
17+
- name: Change the version number
18+
run: |
19+
SU2_PY/change_version_number.py -v "${GITHUB_REF##*/release_v} \"Blackbird\"" -y
20+
- name: Commit files
21+
run: |
22+
git config --local user.email "[email protected]"
23+
git config --local user.name "GitHub Action"
24+
git commit -m "Changing version number to ${GITHUB_REF##*/release_v}" -a
25+
- name: Push changes
26+
uses: ad-m/github-push-action@master
27+
with:
28+
github_token: ${{ secrets.GITHUB_TOKEN }}
29+
branch: ${{ steps.extract_branch.outputs.branch }}

.github/workflows/regression.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ jobs:
1919
config_set: [BaseMPI, ReverseMPI, ForwardMPI, BaseNoMPI, ReverseNoMPI, ForwardNoMPI]
2020
include:
2121
- config_set: BaseMPI
22-
flags: '-Denable-pywrapper=true'
22+
flags: '-Denable-pywrapper=true --werror'
2323
- config_set: ReverseMPI
24-
flags: '-Denable-autodiff=true -Denable-normal=false -Denable-pywrapper=true'
24+
flags: '-Denable-autodiff=true -Denable-normal=false -Denable-pywrapper=true --werror'
2525
- config_set: ForwardMPI
26-
flags: '-Denable-directdiff=true -Denable-normal=false'
26+
flags: '-Denable-directdiff=true -Denable-normal=false --werror'
2727
- config_set: BaseNoMPI
28-
flags: '-Denable-pywrapper=true -Dwith-mpi=disabled'
28+
flags: '-Denable-pywrapper=true -Dwith-mpi=disabled --werror'
2929
- config_set: ReverseNoMPI
30-
flags: '-Denable-autodiff=true -Denable-normal=false -Dwith-mpi=disabled -Denable-pywrapper=true'
30+
flags: '-Denable-autodiff=true -Denable-normal=false -Dwith-mpi=disabled -Denable-pywrapper=true --werror'
3131
- config_set: ForwardNoMPI
32-
flags: '-Denable-directdiff=true -Denable-normal=false -Dwith-mpi=disabled'
32+
flags: '-Denable-directdiff=true -Denable-normal=false -Dwith-mpi=disabled --werror'
3333
runs-on: ubuntu-latest
3434
steps:
3535
- name: Cache Object Files

Common/src/CConfig.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3032,7 +3032,7 @@ void CConfig::SetHeader(unsigned short val_software){
30323032
if ((iZone == 0) && (rank == MASTER_NODE)){
30333033
cout << endl << "-------------------------------------------------------------------------" << endl;
30343034
cout << "| ___ _ _ ___ |" << endl;
3035-
cout << "| / __| | | |_ ) Release 7.0.0 \"Blackbird\" |" << endl;
3035+
cout << "| / __| | | |_ ) Release 7.0.1 \"Blackbird\" |" << endl;
30363036
cout << "| \\__ \\ |_| |/ / |" << endl;
30373037
switch (val_software) {
30383038
case SU2_CFD: cout << "| |___/\\___//___| Suite (Computational Fluid Dynamics Code) |" << endl; break;

SU2_CFD/src/output/CFlowOutput.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,7 @@ void CFlowOutput::WriteForcesBreakdown(CConfig *config, CGeometry *geometry, CSo
13501350

13511351
Breakdown_file << "\n" <<"-------------------------------------------------------------------------" << "\n";
13521352
Breakdown_file << "| ___ _ _ ___ |" << "\n";
1353-
Breakdown_file << "| / __| | | |_ ) Release 7.0.0 \"Blackbird\" |" << "\n";
1353+
Breakdown_file << "| / __| | | |_ ) Release 7.0.1 \"Blackbird\" |" << "\n";
13541354
Breakdown_file << "| \\__ \\ |_| |/ / |" << "\n";
13551355
Breakdown_file << "| |___/\\___//___| Suite (Computational Fluid Dynamics Code) |" << "\n";
13561356
Breakdown_file << "| |" << "\n";

SU2_PY/change_version_number.py

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## \file change_version_number.py
44
# \brief Python script for updating the version number of the SU2 suite.
55
# \author A. Aranake
6-
# \version 7.0.0 "Blackbird"
6+
# \version 7.0.1 "Blackbird"
77
#
88
# SU2 Project Website: https://su2code.github.io
99
#
@@ -27,14 +27,27 @@
2727

2828
# make print(*args) function available in PY2.6+, does'nt work on PY < 2.6
2929
from __future__ import print_function
30-
30+
from optparse import OptionParser
3131
# Run the script from the base directory (ie $SU2HOME). Grep will search directories recursively for matches in version number
3232
import os,sys
3333

34+
parser = OptionParser()
35+
parser.add_option("-v", "--version", dest="version",
36+
help="the new version number", metavar="VERSION")
37+
parser.add_option("-r", "--releasename", dest="releasename",
38+
help="Name of the new release", metavar="RELEASENAME")
39+
parser.add_option("-y", action="store_true", dest="yes", help="Answer yes to all questions", metavar="YES")
40+
(options, args)=parser.parse_args()
41+
42+
if not options.version:
43+
parser.error("new version number must be provided with -v option")
44+
3445
#oldvers = '2012-2018'
3546
#newvers = '2012-2019'
36-
oldvers = '7.0.0 "Blackbird"'
37-
newvers = '7.0.1 "Blackbird"'
47+
oldvers = '7.0.1 "Blackbird"'
48+
oldvers_q= r'7.0.1 \"Blackbird\"'
49+
newvers = options.version + ' "' + options.releasename + '"'
50+
newvers_q= options.version + ' \\"' + options.releasename + '\\"'
3851

3952
if sys.version_info[0] > 2:
4053
# In PY3, raw_input is replaced with input.
@@ -54,21 +67,22 @@
5467

5568
#TODO: replace with portable instructions. This works only on unix systems
5669
os.system("grep -IFwr '%s' *|grep -vF '.svn' |grep -v ISC > version.txt"%oldvers)
70+
os.system("grep -IFwr '%s' --exclude='version.txt' *|grep -vF '.svn' |grep -v ISC >> version.txt"%oldvers_q)
5771

5872
# Create a list of files to adjust
5973
filelist = []
6074
f = open('version.txt','r')
6175
for line in f.readlines():
6276
candidate = line.split(':')[0]
63-
if not candidate in filelist and candidate.find(sys.argv[0])<0:
77+
if not candidate in filelist:
6478
filelist.append(candidate)
6579
f.close()
6680
print(filelist)
6781

6882
# Prompt user before continuing
6983
yorn = ''
70-
while(not yorn.lower()=='y'):
71-
yorn = raw_input('Replace %s with %s in the listed files? [Y/N]: '%(oldvers,newvers))
84+
while(not yorn.lower()=='y' and not options.yes):
85+
yorn = raw_input('Replace %s with %s and %s with %s in the listed files? [Y/N]: '%(oldvers,newvers, oldvers_q, newvers_q))
7286
if yorn.lower()=='n':
7387
print('The file version.txt contains matches of oldvers')
7488
sys.exit()
@@ -77,7 +91,7 @@
7791
for fname in filelist:
7892
s = open(fname,'r').read()
7993
s_new = s.replace(oldvers,newvers)
80-
94+
s_new = s_new.replace(oldvers_q, newvers_q)
8195
f = open(fname,'w')
8296
f.write(s_new)
8397
f.close()

externals/cgns/meson.build

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1+
if build_machine.system() == 'windows'
2+
cgns_default_warnings = []
3+
else
4+
cgns_default_warnings = ['-Wno-unused-result']
5+
endif
16

27
cgns_include = include_directories('adf', './')
38

49
lib_cgns = static_library('cgns',
510
'cgns_internals.c',
6-
'cgns_error.c',
7-
'cgnslib.c',
8-
'cgns_io.c',
9-
'adf/ADF_interface.c',
10-
'adf/ADF_internals.c',
11-
install : false)
11+
'cgns_error.c',
12+
'cgnslib.c',
13+
'cgns_io.c',
14+
'adf/ADF_interface.c',
15+
'adf/ADF_internals.c',
16+
install : false,
17+
c_args: cgns_default_warnings)
1218

1319
cgns_dep = declare_dependency(link_with: lib_cgns,
1420
include_directories: cgns_include)

externals/metis/meson.build

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
metis_c_args = ['-D_FILE_OFFSET_BITS=64', '-DNDEBUG', '-DNDEBUG2', '-DHAVE_GETLINE', '-DUSE_GKREGEX']
2+
3+
if build_machine.system() == 'windows'
4+
metis_default_warnings = []
5+
else
6+
metis_default_warnings = ['-Wno-implicit-function-declaration', '-Wno-unused-result']
7+
endif
8+
29
metis_src = ['GKlib/pqueue.c',
310
'GKlib/blas.c',
411
'GKlib/fkvkselect.c',
@@ -65,7 +72,7 @@ metis_include = include_directories(['include','GKlib','libmetis'])
6572
metis_lib = static_library('metis',
6673
metis_src,
6774
include_directories : metis_include,
68-
c_args: metis_c_args)
75+
c_args: metis_c_args + metis_default_warnings)
6976

7077
metis_dep = declare_dependency(link_with : metis_lib,
7178
include_directories : metis_include)

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
project('SU2', 'c', 'cpp',
2-
version: '7.0.1',
2+
version: '7.0.1 "Blackbird"',
33
license: 'LGPL2',
44
default_options: ['buildtype=release',
55
'warning_level=0',

0 commit comments

Comments
 (0)