Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba5508b39e | ||
|
|
d5eab412b4 | ||
|
|
fff4249771 | ||
|
|
11e2f1852b | ||
|
|
53e23e3684 | ||
|
|
f0ce39129c | ||
|
|
1583d41197 |
@@ -15,14 +15,6 @@
|
||||
cache:
|
||||
- C:\Users\appveyor\.tools -> appveyor\do.py
|
||||
|
||||
#---------------------------------#
|
||||
# additional packages #
|
||||
#---------------------------------#
|
||||
|
||||
install:
|
||||
# for the sequencer
|
||||
- cinst re2c
|
||||
|
||||
#---------------------------------#
|
||||
# repository cloning #
|
||||
#---------------------------------#
|
||||
@@ -31,6 +23,8 @@ install:
|
||||
init:
|
||||
# Set autocrlf to make batch files work
|
||||
- git config --global core.autocrlf true
|
||||
# print the connection info for RDP connections (see 'debugging' below)
|
||||
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||
|
||||
# Set clone depth (do not fetch complete history)
|
||||
clone_depth: 50
|
||||
@@ -44,6 +38,16 @@ skip_commits:
|
||||
- '**/*.md'
|
||||
- '.travis.yml'
|
||||
|
||||
#---------------------------------#
|
||||
# additional packages #
|
||||
#---------------------------------#
|
||||
|
||||
install:
|
||||
# fetch submodules (like ci-scripts)
|
||||
- cmd: git submodule update --init --recursive
|
||||
# for the sequencer
|
||||
- cinst re2c
|
||||
|
||||
#---------------------------------#
|
||||
# build matrix configuration #
|
||||
#---------------------------------#
|
||||
@@ -144,7 +148,6 @@ test_script:
|
||||
## so you may want to adjust the build matrix above to just build the one of interest
|
||||
|
||||
#on_failure:
|
||||
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||
|
||||
|
||||
|
||||
10
README.md
10
README.md
@@ -198,8 +198,8 @@ specific job will run the job with high verbosity,
|
||||
printing every command as it is being executed and switching the dependency
|
||||
builds to higher verbosity.
|
||||
|
||||
For local debugging, you may set `CACHEDIR` to change the location for the
|
||||
dependency builds. [default is `$HOME/.cache`]
|
||||
For debugging on your local machine, you may set `CACHEDIR` to change the
|
||||
location for the dependency builds. [default is `$HOME/.cache`]
|
||||
|
||||
## References: EPICS Modules Using ci-scripts
|
||||
|
||||
@@ -236,16 +236,16 @@ This will make all builds (not just for your module) verbose.
|
||||
|
||||
Update the submodule in `.ci` first, then change your CI configuration
|
||||
(if needed) and commit both to your module. E.g., to update your Travis
|
||||
setup to release 2.3.4 of ci-scripts:
|
||||
setup to release 2.3.5 of ci-scripts:
|
||||
```bash
|
||||
cd .ci
|
||||
git pull origin v2.3.4
|
||||
git pull origin v2.3.5
|
||||
cd -
|
||||
git add .ci
|
||||
# if needed:
|
||||
edit .travis.yml
|
||||
git add .travis.yml
|
||||
git commit -m "Update ci-scripts submodule to v2.3.4"
|
||||
git commit -m "Update ci-scripts submodule to v2.3.5"
|
||||
```
|
||||
|
||||
Check the example configuration files inside ci-scripts (and their
|
||||
|
||||
@@ -308,9 +308,11 @@ class TestSetupForBuild(unittest.TestCase):
|
||||
platform = os.environ['PLATFORM']
|
||||
cc = os.environ['CMP']
|
||||
args = Namespace(paths=[])
|
||||
do.building_base = True
|
||||
|
||||
def setUp(self):
|
||||
os.environ.pop('EPICS_HOST_ARCH', None)
|
||||
do.clear_lists()
|
||||
|
||||
def tearDown(self):
|
||||
os.environ['CONFIGURATION'] = self.configuration
|
||||
@@ -380,6 +382,47 @@ class TestSetupForBuild(unittest.TestCase):
|
||||
self.assertTrue(re.search('strawberry', os.environ['PATH'], flags=re.IGNORECASE),
|
||||
'Strawberry Perl location not in PATH for vs2019')
|
||||
|
||||
def setBase314(self, yesno):
|
||||
cfg_base_version = os.path.join('configure', 'CONFIG_BASE_VERSION')
|
||||
fout = open(cfg_base_version, 'w')
|
||||
print('# test file for base version detection', file=fout)
|
||||
print('BASE_3_14={0}'.format(yesno), file=fout)
|
||||
fout.close()
|
||||
|
||||
def setTestResultsTarget(self, target):
|
||||
rules_build = os.path.join('configure', 'RULES_BUILD')
|
||||
fout = open(rules_build, 'w')
|
||||
print('# test file for target detection', file=fout)
|
||||
print('{0}: something'.format(target), file=fout)
|
||||
fout.close()
|
||||
|
||||
def test_DetectionBase314No(self):
|
||||
self.setBase314('NO')
|
||||
do.setup_for_build(self.args)
|
||||
self.assertFalse(do.isbase314, 'Falsely detected Base 3.14')
|
||||
|
||||
def test_DetectionBase314Yes(self):
|
||||
self.setBase314('YES')
|
||||
do.setup_for_build(self.args)
|
||||
self.assertTrue(do.isbase314, 'Base 3.14 = YES not detected')
|
||||
|
||||
def test_DetectionTestResultsTarget314No(self):
|
||||
self.setBase314('YES')
|
||||
self.setTestResultsTarget('nottherighttarget')
|
||||
do.setup_for_build(self.args)
|
||||
self.assertFalse(do.has_test_results, 'Falsely detected test-results target')
|
||||
|
||||
def test_DetectionTestResultsTarget314Yes(self):
|
||||
self.setBase314('YES')
|
||||
self.setTestResultsTarget('test-results')
|
||||
do.setup_for_build(self.args)
|
||||
self.assertFalse(do.has_test_results, 'Falsely found test-results on Base 3.14')
|
||||
|
||||
def test_DetectionTestResultsTargetNot314Yes(self):
|
||||
self.setBase314('NO')
|
||||
self.setTestResultsTarget('test-results')
|
||||
do.setup_for_build(self.args)
|
||||
self.assertTrue(do.has_test_results, 'Target test-results not detected')
|
||||
|
||||
if __name__ == "__main__":
|
||||
if 'VV' in os.environ and os.environ['VV'] == '1':
|
||||
|
||||
@@ -12,14 +12,6 @@
|
||||
cache:
|
||||
- C:\Users\appveyor\.tools
|
||||
|
||||
#---------------------------------#
|
||||
# additional packages #
|
||||
#---------------------------------#
|
||||
|
||||
install:
|
||||
# for the sequencer
|
||||
- cinst re2c
|
||||
|
||||
#---------------------------------#
|
||||
# repository cloning #
|
||||
#---------------------------------#
|
||||
@@ -43,6 +35,16 @@ skip_commits:
|
||||
- '**/*.md'
|
||||
- '.travis.yml'
|
||||
|
||||
#---------------------------------#
|
||||
# additional packages #
|
||||
#---------------------------------#
|
||||
|
||||
install:
|
||||
# fetch submodules (like ci-scripts)
|
||||
- cmd: git submodule update --init --recursive
|
||||
# for the sequencer
|
||||
- cinst re2c
|
||||
|
||||
#---------------------------------#
|
||||
# build matrix configuration #
|
||||
#---------------------------------#
|
||||
@@ -113,11 +115,8 @@ matrix:
|
||||
# building & testing #
|
||||
#---------------------------------#
|
||||
|
||||
install:
|
||||
- cmd: git submodule update --init --recursive
|
||||
- cmd: python .ci/appveyor/do.py prepare
|
||||
|
||||
build_script:
|
||||
- cmd: python .ci/appveyor/do.py prepare
|
||||
- cmd: python .ci/appveyor/do.py build
|
||||
|
||||
test_script:
|
||||
|
||||
@@ -19,6 +19,9 @@ skip_commits:
|
||||
- '**/*.md'
|
||||
- '.travis.yml'
|
||||
|
||||
install:
|
||||
- cmd: git submodule update --init --recursive
|
||||
|
||||
image: Visual Studio 2019
|
||||
|
||||
# Build Configurations: dll/static, regular/debug
|
||||
@@ -54,11 +57,8 @@ matrix:
|
||||
- platform: x64
|
||||
CMP: vs2008
|
||||
|
||||
install:
|
||||
- cmd: git submodule update --init --recursive
|
||||
- cmd: python .ci/appveyor/do.py prepare
|
||||
|
||||
build_script:
|
||||
- cmd: python .ci/appveyor/do.py prepare
|
||||
- cmd: python .ci/appveyor/do.py build
|
||||
|
||||
test_script:
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
1. Get an account on [AppVeyor](https://www.appveyor.com/), connect
|
||||
it to your GitHub account and activate your support module's
|
||||
repository. For more details, please refer to the
|
||||
repository. For more details, please see below and refer to the
|
||||
[AppVeyor documentation](https://www.appveyor.com/docs/).
|
||||
|
||||
2. Add the ci-scripts respository as a Git Submodule
|
||||
@@ -45,15 +45,56 @@
|
||||
|
||||
Your builds will take long. \
|
||||
AppVeyor only grants a single worker VM - all jobs of the matrix are
|
||||
executed sequentially. Each job will take around 10 minutes.
|
||||
executed sequentially. Each job will take between 6 and 15 minutes,
|
||||
plus testing time.
|
||||
|
||||
The `matrix: / exclude:` setting can be used to reduce the number of
|
||||
jobs. Check the [AppVeyor docs](https://www.appveyor.com/docs/build-configuration/#build-matrix)
|
||||
jobs. Check the [AppVeyor docs][appveyor.doc.matrix]
|
||||
for more ways to reduce the build matrix size.
|
||||
E.g., you can opt for not creating matrix axes for `configuration:`
|
||||
and`platform:` by moving these configurations into the job lines
|
||||
under `environment: / matrix:`.
|
||||
|
||||
6. Push your changes and check
|
||||
[ci.appveyor.com](https://ci.appveyor.com/) for your build results.
|
||||
|
||||
## GitHub / AppVeyor Integration and Authentication
|
||||
|
||||
### Security
|
||||
Enabling Two-Factor-Authentication (2FA) is always a good idea, for all
|
||||
your web based services, including GitHub and AppVeyor. \
|
||||
Get an app for your phone (Authy works fine for me, but there are plenty),
|
||||
and your phone will generate one-time passwords to verify your identity
|
||||
to the service if required (e.g., when logging in from a new device).
|
||||
|
||||
### Authentication
|
||||
You can use different ways and services to authenticate when you log into
|
||||
your AppVeyor account. The easiest way - at least when you're using the
|
||||
service with repositories on GitHub - is to use GitHub authentication.
|
||||
|
||||
### GitHub Integration
|
||||
AppVeyor offers two ways to integrate with GitHub: through a GitHub
|
||||
application or through an OAuth application. GitHub applications are using
|
||||
the newer API, allow easier fine-grained access rights tuning and are
|
||||
preferred.
|
||||
|
||||
The differences are mostly visible when you work with repositories under
|
||||
organizational GitHub accounts: Using OAuth, AppVeyor always has the full
|
||||
rights of your personal GitHub account.
|
||||
GitHub applications on the other hand have separate instances and
|
||||
configuration for every organizational account you are using on GitHub.
|
||||
|
||||
### Enabling Builds for your Repository
|
||||
On the 'Projects' tab of your AppVeyor web interface, create a new project.
|
||||
If the repository is not listed on the project creation page,
|
||||
verify the Integration settings. Most of the relevant configuration
|
||||
is taken from GitHub and has to be set up there.
|
||||
|
||||
### AppVeyor Account Sharing
|
||||
You can always invite other AppVeyor users to have access to an AppVeyor
|
||||
account, forming a team. Such additional shared accounts are a way to make
|
||||
the AppVeyor limits (e.g., one parallel builder per account) more manageable.
|
||||
|
||||
## Known Issues
|
||||
|
||||
#### Build Worker Images
|
||||
@@ -66,3 +107,6 @@ is shown in the example configuration files:
|
||||
- Set the default image using the `image:` tag.
|
||||
- Override the image for specific jobs by setting the
|
||||
`APPVEYOR_BUILD_WORKER_IMAGE` environment variable.
|
||||
|
||||
<!-- Links -->
|
||||
[appveyor.doc.matrix]: https://www.appveyor.com/docs/build-configuration/#build-matrix
|
||||
|
||||
@@ -78,6 +78,7 @@ def modlist():
|
||||
zip7 = r'C:\Program Files\7-Zip\7z'
|
||||
make = ''
|
||||
isbase314 = False
|
||||
has_test_results = False
|
||||
silent_dep_builds = True
|
||||
|
||||
def host_info():
|
||||
@@ -99,10 +100,13 @@ def host_info():
|
||||
|
||||
# Used from unittests
|
||||
def clear_lists():
|
||||
global isbase314, has_test_results
|
||||
del seen_setups[:]
|
||||
del modules_to_compile[:]
|
||||
setup.clear()
|
||||
places.clear()
|
||||
isbase314 = False
|
||||
has_test_results = False
|
||||
|
||||
# Error-handler to make shutil.rmtree delete read-only files on Windows
|
||||
def remove_readonly(func, path, excinfo):
|
||||
@@ -357,7 +361,7 @@ def add_dependency(dep):
|
||||
update_release_local(setup[dep+"_VARNAME"], place)
|
||||
|
||||
def setup_for_build(args):
|
||||
global make, isbase314
|
||||
global make, isbase314, has_test_results
|
||||
dllpaths = []
|
||||
|
||||
# there is no combined static and debug EPICS_HOST_ARCH target,
|
||||
@@ -415,6 +419,14 @@ def setup_for_build(args):
|
||||
if 'BASE_3_14=YES' in myfile.read():
|
||||
isbase314 = True
|
||||
|
||||
if not isbase314:
|
||||
rules_build = os.path.join(base_place, 'configure', 'RULES_BUILD')
|
||||
if os.path.exists(rules_build):
|
||||
with open(rules_build) as myfile:
|
||||
for line in myfile:
|
||||
if re.match('^test-results:', line):
|
||||
has_test_results = True
|
||||
|
||||
bindir = os.path.join(os.getcwd(), 'bin', os.environ['EPICS_HOST_ARCH'])
|
||||
if os.path.isdir(bindir):
|
||||
dllpaths.append(bindir)
|
||||
@@ -480,6 +492,29 @@ def prepare(args):
|
||||
else:
|
||||
optitype = 'optimized'
|
||||
|
||||
# Enable/fix parallel build for VisualStudio compiler on older Base versions
|
||||
add_vs_fix = True
|
||||
config_win = os.path.join(places['EPICS_BASE'], 'configure', 'os', 'CONFIG.win32-x86.win32-x86')
|
||||
with open(config_win) as myfile:
|
||||
for line in myfile:
|
||||
if re.match(r'^ifneq \(\$\(VisualStudioVersion\),11\.0\)', line):
|
||||
add_vs_fix = False
|
||||
if add_vs_fix:
|
||||
with open(config_win, 'a') as myfile:
|
||||
myfile.write('''
|
||||
# Fix parallel build for some VisualStudio versions
|
||||
ifneq ($(VisualStudioVersion),)
|
||||
ifneq ($(VisualStudioVersion),11.0)
|
||||
ifeq ($(findstring -FS,$(OPT_CXXFLAGS_NO)),)
|
||||
OPT_CXXFLAGS_NO += -FS
|
||||
OPT_CFLAGS_NO += -FS
|
||||
endif
|
||||
else
|
||||
OPT_CXXFLAGS_NO := $(filter-out -FS,$(OPT_CXXFLAGS_NO))
|
||||
OPT_CFLAGS_NO := $(filter-out -FS,$(OPT_CFLAGS_NO))
|
||||
endif
|
||||
endif''')
|
||||
|
||||
print('EPICS Base build system set up for {0} build with {1} linking'
|
||||
.format(optitype, linktype))
|
||||
|
||||
@@ -541,7 +576,8 @@ def test(args):
|
||||
setup_for_build(args)
|
||||
print('{0}Running the main module tests{1}'.format(ANSI_YELLOW, ANSI_RESET))
|
||||
call_make(['tapfiles'])
|
||||
call_make(['test-results'], parallel=0, silent=True)
|
||||
if has_test_results:
|
||||
call_make(['test-results'], parallel=0, silent=True)
|
||||
|
||||
def doExec(args):
|
||||
'exec user command with vcvars'
|
||||
|
||||
@@ -43,3 +43,18 @@
|
||||
|
||||
6. Push your changes and check
|
||||
[travis-ci.org](https://travis-ci.org/) for your build results.
|
||||
|
||||
## Caches
|
||||
|
||||
Travis keeps the caches separate for different jobs. As soon as the job
|
||||
description (in the `.travis.yml` configuration file) or its environment
|
||||
settings change (adding a space character is enough), the cache is different
|
||||
and will be rebuilt when the job runs.
|
||||
|
||||
This also means that changing a value inside a setup file will _not_
|
||||
invalidate the cache - in that case you will have to manually delete the cache
|
||||
through the Travis web interface. (Or add a space character in the job
|
||||
configuration.)
|
||||
|
||||
Caches are automatically removed after approx. four weeks.
|
||||
Your jobs will have to rebuild them once in a while.
|
||||
|
||||
@@ -37,7 +37,10 @@ if [ "$TEST" != "NO" ]
|
||||
then
|
||||
make -j2 tapfiles || ret=$?
|
||||
|
||||
make -sk test-results
|
||||
if grep -q "BASE_3_14=NO" $EPICS_BASE/configure/CONFIG_BASE_VERSION
|
||||
then
|
||||
grep -q "^test-results:" $EPICS_BASE/configure/RULES_BUILD && make -sk test-results
|
||||
fi
|
||||
fi
|
||||
|
||||
exit $ret
|
||||
|
||||
Reference in New Issue
Block a user