60 Commits

Author SHA1 Message Date
Ralph Lange
1a227516c5 Update README
Some checks failed
ci-scripts build/test / Unit tests on macos-10.15 (push) Has been cancelled
ci-scripts build/test / Unit tests on ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / Unit tests on ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / Unit tests on ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / Unit tests on windows-2016 (push) Has been cancelled
ci-scripts build/test / Unit tests on windows-2019 (push) Has been cancelled
ci-scripts build/test / clang / debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / clang / debug / ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / clang / debug / ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / clang / default / ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / clang / default / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / clang / default / ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / clang / static / ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / clang / static / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / clang / static / ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / clang / static-debug / ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / clang / static-debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / clang / static-debug / ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / gcc / debug / ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / gcc / debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / gcc / debug / ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / gcc / default / ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / gcc / default / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / gcc / default / ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / gcc / static / ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / gcc / static / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / gcc / static / ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / gcc / static-debug / ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / gcc / static-debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / gcc / static-debug / ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / clang / debug / macos-10.15 (push) Has been cancelled
ci-scripts build/test / clang / default / macos-10.15 (push) Has been cancelled
ci-scripts build/test / gcc / debug / windows-2016 (push) Has been cancelled
ci-scripts build/test / gcc / debug / windows-2019 (push) Has been cancelled
ci-scripts build/test / gcc / default / windows-2016 (push) Has been cancelled
ci-scripts build/test / gcc / default / windows-2019 (push) Has been cancelled
ci-scripts build/test / gcc / static / windows-2016 (push) Has been cancelled
ci-scripts build/test / gcc / static / windows-2019 (push) Has been cancelled
ci-scripts build/test / gcc / static-debug / windows-2016 (push) Has been cancelled
ci-scripts build/test / gcc / static-debug / windows-2019 (push) Has been cancelled
ci-scripts build/test / vs2017 / debug / windows-2016 (push) Has been cancelled
ci-scripts build/test / vs2017 / default / windows-2016 (push) Has been cancelled
ci-scripts build/test / vs2017 / static / windows-2016 (push) Has been cancelled
ci-scripts build/test / vs2017 / static-debug / windows-2016 (push) Has been cancelled
ci-scripts build/test / vs2019 / debug / windows-2019 (push) Has been cancelled
ci-scripts build/test / vs2019 / default / windows-2019 (push) Has been cancelled
ci-scripts build/test / vs2019 / static / windows-2019 (push) Has been cancelled
ci-scripts build/test / vs2019 / static-debug / windows-2019 (push) Has been cancelled
ci-scripts build/test / RTEMS4.10 / debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / RTEMS4.9 / debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / RTEMS4.10 / default / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / RTEMS4.9 / default / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / WINE32 / debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / WINE64 / debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / WINE32 / default / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / WINE64 / default / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / WINE32 / static / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / WINE64 / static / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / WINE32 / static-debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / WINE64 / static-debug / ubuntu-18.04 (push) Has been cancelled
2020-10-19 08:51:16 +02:00
Michael Davidsaver
bfb9f77db8 fix help formatting 2020-10-17 11:32:00 -07:00
Ralph Lange
12a0656fd2 Merge pull request #55 from ralphlange/devel/gitlab
Support for GitLab CI/CD
(closes #51)
2020-09-14 10:32:40 +02:00
Ralph Lange
984fa5e355 Examples: improve job names in example-mini 2020-09-14 09:36:37 +02:00
Ralph Lange
43e52b5f6f Readme: add remark on CI service free tier vs. "Enterprise" installation 2020-09-14 09:30:32 +02:00
Ralph Lange
3c1cf15dac Readme: add remarks on CI services free tier vs. "Enterprise" installation 2020-09-14 09:29:02 +02:00
Ralph Lange
506af3932d gitlab: add examples and README 2020-09-07 14:55:10 +02:00
Ralph Lange
85a34ceefb gitlab: add p7zip-full to pre-installed packages 2020-09-07 13:44:19 +02:00
Ralph Lange
705f50449e cue: cachedir -> ci[]; move cache inside project on GitLab 2020-09-07 13:44:19 +02:00
Ralph Lange
d6136de065 gitlab: add jobs for WINE32/64 and RTEMS4.9/4.10 2020-09-07 13:42:57 +02:00
Ralph Lange
33cac7c965 cue: make 'sudo' use for apt-get configurable 2020-09-07 13:42:57 +02:00
Ralph Lange
1c748ae291 gitlab: install python and essential packages before calling cue.py 2020-09-07 13:40:12 +02:00
Ralph Lange
7744772be6 gitlab: add .gitlab-ci.yml to run gcc & clang jobs on GitLab-CI 2020-09-07 13:40:12 +02:00
Ralph Lange
682f92941d cue: add GitLab to service detection 2020-09-07 13:40:12 +02:00
Ralph Lange
032ef83502 cue: run apt-get 'update' before 'install' 2020-09-07 11:45:30 +02:00
Ralph Lange
cfd8a88488 cue-test: don't install Strawberry Perl on AppVeyor
(on AppVeyor / VS2019, Strawberry is installed)
2020-09-07 11:11:47 +02:00
Ralph Lange
54a104e0a6 Remove explicitly 'static' builds for RTEMS
(as all RTEMS builds are static by definition)
2020-09-06 19:14:26 +02:00
Ralph Lange
884d017650 cue: fix warning (default argument mutable) 2020-09-06 19:08:34 +02:00
Ralph Lange
fd71e94dd4 Revert "Use patch to add RTEMS-pc386-qemu target to older base"
Patching is not flexible enough
to cover the full range of Base 3.15 source versions.

(This reverts commit 59304f83.)
2020-09-06 16:12:49 +02:00
Ralph Lange
eb5edd3055 cue: fix regex matching for patch and archive HOOKs 2020-07-30 14:14:20 +02:00
Ralph Lange
87942a7c29 Update READMEs (quoting of branch/tag name settings)
Some checks failed
ci-scripts build/test / Unit tests on macos-10.15 (push) Has been cancelled
ci-scripts build/test / Unit tests on ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / Unit tests on ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / Unit tests on windows-2016 (push) Has been cancelled
ci-scripts build/test / Unit tests on windows-2019 (push) Has been cancelled
ci-scripts build/test / clang / static / ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / gcc / debug / ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / gcc / static / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / gcc / static / ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / gcc / static-debug / ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / gcc / static-debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / gcc / static-debug / ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / clang / debug / macos-10.15 (push) Has been cancelled
ci-scripts build/test / Unit tests on ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / clang / debug / ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / clang / debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / clang / debug / ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / clang / default / ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / clang / default / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / clang / default / ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / clang / static / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / clang / static / ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / clang / static-debug / ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / clang / static-debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / clang / static-debug / ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / gcc / debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / gcc / debug / ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / gcc / default / ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / gcc / default / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / gcc / default / ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / gcc / static / ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / clang / default / macos-10.15 (push) Has been cancelled
ci-scripts build/test / gcc / debug / windows-2016 (push) Has been cancelled
ci-scripts build/test / gcc / debug / windows-2019 (push) Has been cancelled
ci-scripts build/test / gcc / default / windows-2016 (push) Has been cancelled
ci-scripts build/test / gcc / default / windows-2019 (push) Has been cancelled
ci-scripts build/test / gcc / static / windows-2016 (push) Has been cancelled
ci-scripts build/test / gcc / static / windows-2019 (push) Has been cancelled
ci-scripts build/test / gcc / static-debug / windows-2016 (push) Has been cancelled
ci-scripts build/test / gcc / static-debug / windows-2019 (push) Has been cancelled
ci-scripts build/test / vs2017 / debug / windows-2016 (push) Has been cancelled
ci-scripts build/test / vs2017 / default / windows-2016 (push) Has been cancelled
ci-scripts build/test / vs2017 / static / windows-2016 (push) Has been cancelled
ci-scripts build/test / vs2017 / static-debug / windows-2016 (push) Has been cancelled
ci-scripts build/test / vs2019 / debug / windows-2019 (push) Has been cancelled
ci-scripts build/test / vs2019 / default / windows-2019 (push) Has been cancelled
ci-scripts build/test / vs2019 / static / windows-2019 (push) Has been cancelled
ci-scripts build/test / vs2019 / static-debug / windows-2019 (push) Has been cancelled
ci-scripts build/test / RTEMS4.10 / debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / RTEMS4.9 / debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / RTEMS4.10 / default / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / RTEMS4.9 / default / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / RTEMS4.10 / static / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / RTEMS4.9 / static / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / RTEMS4.10 / static-debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / RTEMS4.9 / static-debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / WINE32 / debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / WINE64 / debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / WINE32 / default / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / WINE64 / default / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / WINE32 / static / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / WINE64 / static / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / WINE32 / static-debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / WINE64 / static-debug / ubuntu-18.04 (push) Has been cancelled
2020-06-30 09:49:50 +02:00
Ralph Lange
0bf7d23a6f Merge pull request #54 from mdavidsaver/gh-actions
gh-actions: fix example configurations
2020-06-30 09:40:04 +02:00
Michael Davidsaver
b592ab053c fixup github actions examples 2020-06-29 13:31:02 -07:00
Ralph Lange
e10326b129 Update top README (reference module list, version number)
Some checks failed
ci-scripts build/test / clang / debug / ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / clang / debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / clang / debug / ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / clang / default / ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / clang / default / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / clang / default / ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / clang / static / ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / clang / static / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / clang / static / ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / clang / static-debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / clang / static-debug / ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / Unit tests on macos-10.15 (push) Has been cancelled
ci-scripts build/test / Unit tests on ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / Unit tests on ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / Unit tests on ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / Unit tests on windows-2016 (push) Has been cancelled
ci-scripts build/test / Unit tests on windows-2019 (push) Has been cancelled
ci-scripts build/test / clang / static-debug / ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / gcc / default / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / gcc / default / ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / gcc / static / ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / gcc / static / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / gcc / static / ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / gcc / static-debug / ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / gcc / static-debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / gcc / static-debug / ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / gcc / debug / ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / gcc / debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / gcc / debug / ubuntu-20.04 (push) Has been cancelled
ci-scripts build/test / gcc / default / ubuntu-16.04 (push) Has been cancelled
ci-scripts build/test / gcc / default / windows-2016 (push) Has been cancelled
ci-scripts build/test / gcc / default / windows-2019 (push) Has been cancelled
ci-scripts build/test / clang / debug / macos-10.15 (push) Has been cancelled
ci-scripts build/test / clang / default / macos-10.15 (push) Has been cancelled
ci-scripts build/test / gcc / debug / windows-2016 (push) Has been cancelled
ci-scripts build/test / gcc / debug / windows-2019 (push) Has been cancelled
ci-scripts build/test / gcc / static / windows-2016 (push) Has been cancelled
ci-scripts build/test / gcc / static / windows-2019 (push) Has been cancelled
ci-scripts build/test / gcc / static-debug / windows-2016 (push) Has been cancelled
ci-scripts build/test / gcc / static-debug / windows-2019 (push) Has been cancelled
ci-scripts build/test / vs2017 / debug / windows-2016 (push) Has been cancelled
ci-scripts build/test / vs2017 / default / windows-2016 (push) Has been cancelled
ci-scripts build/test / vs2017 / static / windows-2016 (push) Has been cancelled
ci-scripts build/test / vs2017 / static-debug / windows-2016 (push) Has been cancelled
ci-scripts build/test / vs2019 / debug / windows-2019 (push) Has been cancelled
ci-scripts build/test / vs2019 / default / windows-2019 (push) Has been cancelled
ci-scripts build/test / vs2019 / static / windows-2019 (push) Has been cancelled
ci-scripts build/test / vs2019 / static-debug / windows-2019 (push) Has been cancelled
ci-scripts build/test / RTEMS4.10 / debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / RTEMS4.9 / debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / RTEMS4.10 / default / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / RTEMS4.9 / default / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / RTEMS4.10 / static / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / RTEMS4.9 / static / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / RTEMS4.10 / static-debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / RTEMS4.9 / static-debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / WINE32 / debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / WINE64 / debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / WINE32 / default / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / WINE64 / default / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / WINE32 / static / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / WINE64 / static / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / WINE32 / static-debug / ubuntu-18.04 (push) Has been cancelled
ci-scripts build/test / WINE64 / static-debug / ubuntu-18.04 (push) Has been cancelled
2020-06-29 17:32:36 +02:00
Ralph Lange
bd7612dcab Add install of 'p7zip-full' to Travis configuration and docs 2020-06-29 16:51:36 +02:00
Ralph Lange
1b066feacc Special treatment for .patch and .zip/.7z HOOK files
(closes #44)
2020-06-29 15:43:11 +02:00
Ralph Lange
ee362d84aa gh-actions: set 'on:' filter to build everything
- push and pull_request notifications for all branches
2020-06-29 12:13:28 +02:00
Ralph Lange
9942f81988 Fix link in top README 2020-06-29 12:02:26 +02:00
Ralph Lange
ce99ab4e52 Merge pull request #52 from ralphlange/devel/gh-actions
Add support for GitHub Actions
2020-06-29 10:45:23 +02:00
Ralph Lange
08d2f23295 Update README files; add gh-action example files 2020-06-29 10:44:15 +02:00
Ralph Lange
a439d7aa64 cue: add fold control for gh-actions 2020-06-29 10:44:15 +02:00
Ralph Lange
6eefee8d18 gh-actions: add jobs for WINE cross builds 2020-06-29 10:44:15 +02:00
Ralph Lange
c7a134e1fb cue: use sudo when unpacking rtems cross compiler (WA)
- not needed on Travis (where target directory is under HOME)
2020-06-29 10:44:14 +02:00
Ralph Lange
ba5173a494 gh-actions: add jobs for RTEMS cross builds 2020-06-29 10:44:14 +02:00
Ralph Lange
b568ca982b cue: set PERL to Strawberry on gh-actions/windows 2020-06-29 10:44:14 +02:00
Ralph Lange
04f99fe6c4 gh-actions: add jobs for clang; failfast = false 2020-06-29 10:44:14 +02:00
Ralph Lange
0b54ff61c4 gh-actions: add configuration; split linux/macos/windows builds 2020-06-29 10:44:14 +02:00
Ralph Lange
074a7ab617 gh-actions: add windows-2016, ubuntu-20.04 jobs 2020-06-29 10:44:14 +02:00
Ralph Lange
5a0acc2228 cue: quiet down chocolatey installation 2020-06-29 10:44:14 +02:00
Ralph Lange
1c0f786eeb gh-actions: install re2c from BREW 2020-06-29 10:44:14 +02:00
Ralph Lange
4b76e0623d cue: install Homebrew packages from BREW on macOS 2020-06-29 10:44:14 +02:00
Ralph Lange
e8508cb658 gh-actions: add macOS jobs 2020-06-29 10:44:14 +02:00
Ralph Lange
388cc57533 gh-actions: improve naming 2020-06-29 10:44:14 +02:00
Ralph Lange
5beeada73f cue: improve logging in setup_for_build() 2020-06-29 10:44:14 +02:00
Ralph Lange
348a7dc851 cue-test: set platform/compiler correctly for windows tests 2020-06-29 10:44:14 +02:00
Ralph Lange
ab52808c63 cue-test: add 'findvs' action
walks the file system to find 'vcvarsall.bat'
2020-06-29 10:44:14 +02:00
Ralph Lange
3a99f3c9d6 cue: add vcvarsall.bat location for vs2019/Enterprise
as used by GitHub Actions windows-2019 runner
2020-06-29 10:44:14 +02:00
Ralph Lange
6c645363b3 gh-actions: add vs2019 build on windows 2020-06-29 10:44:13 +02:00
Ralph Lange
2dbd777852 gh-actions: improve workflow naming; choco install re2c 2020-06-29 10:44:13 +02:00
Ralph Lange
576b5a4caf cue: fix adding Strawberry Perl to PATH 2020-06-29 10:44:13 +02:00
Ralph Lange
031a756941 gh-actions: move environment setting to workflow level 2020-06-29 10:44:13 +02:00
Ralph Lange
f324cd3bdd Add proper detection for github-actions service 2020-06-29 10:44:13 +02:00
Ralph Lange
0ba02c5b03 gh-actions: initial build-and-test.yml
runs unit tests and a simple gcc build on Linux and Windows
2020-06-29 10:44:13 +02:00
Ralph Lange
b0c910c1cc appveyor: don't trigger build on changes in .github/workflow 2020-06-29 10:44:13 +02:00
Ralph Lange
59304f83c2 Use patch to add RTEMS-pc386-qemu target to older base 2020-06-29 10:44:13 +02:00
Ralph Lange
b3091e6d6f cue: fix EXTRA settings for build action 2020-06-23 17:35:13 +02:00
Ralph Lange
1a996e5407 cue: fix erroneous entries in /etc/hosts on Travis 2020-06-23 15:46:46 +02:00
Ralph Lange
f927e475ff cue: install apt packages from APT on linux 2020-06-22 15:04:22 +02:00
Ralph Lange
fbd6bac81a cue: clean dependencies after build (reduces cache size)
- support CLEAN_DEPS=NO to leave dependencies uncleaned
  (fixes #48)
2020-06-19 17:10:02 +02:00
Ralph Lange
12d769835e cue: fix issue introduced in 35f5befa
- was leading to jobs failing if setup file was
  not found in the first directory of search path
2020-06-15 14:16:16 +02:00
19 changed files with 1208 additions and 122 deletions

View File

@@ -37,6 +37,7 @@ skip_commits:
- '**/*.html'
- '**/*.md'
- '.travis.yml'
- '.github/workflows/*'
#---------------------------------#
# additional packages #
@@ -80,6 +81,7 @@ environment:
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- CMP: vs2019
BASE: 3.15
CLEAN_DEPS: NO
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- CMP: vs2019
BASE: 3.14

154
.github/workflows/build-and-test.yml vendored Normal file
View File

@@ -0,0 +1,154 @@
name: ci-scripts build/test
on: [push, pull_request]
env:
SETUP_PATH: .:.ci
SET: test01
VV: 1
BASE_RECURSIVE: NO
CMP: gcc
APT: re2c
CHOCO: re2c
BREW: re2c
jobs:
unit-test:
name: Unit tests on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-18.04, ubuntu-16.04, windows-2019, windows-2016, macos-10.15]
steps:
- uses: actions/checkout@v2
- name: Show initial environment
run: python cue-test.py env
- name: Run unit tests
run: python cue-test.py
build-linux:
name: ${{ matrix.cmp }} / ${{ matrix.configuration }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
CMP: ${{ matrix.cmp }}
BCFG: ${{ matrix.configuration }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-18.04, ubuntu-16.04]
cmp: [gcc, clang]
configuration: [default, static, debug, static-debug]
steps:
- uses: actions/checkout@v2
- name: Prepare and compile dependencies
run: python cue.py prepare
- name: Build main module (example app)
run: python cue.py build
- name: Run main module tests
run: python cue.py test
- name: Collect and show test results
run: python cue.py test-results
build-macos:
name: ${{ matrix.cmp }} / ${{ matrix.configuration }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
CMP: ${{ matrix.cmp }}
BCFG: ${{ matrix.configuration }}
strategy:
fail-fast: false
matrix:
os: [macos-10.15]
cmp: [clang]
configuration: [default, debug]
steps:
- uses: actions/checkout@v2
- name: Prepare and compile dependencies
run: python cue.py prepare
- name: Build main module (example app)
run: python cue.py build
- name: Run main module tests
run: python cue.py test
- name: Collect and show test results
run: python cue.py test-results
build-windows:
name: ${{ matrix.cmp }} / ${{ matrix.configuration }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
CMP: ${{ matrix.cmp }}
BCFG: ${{ matrix.configuration }}
strategy:
fail-fast: false
matrix:
os: [windows-2019, windows-2016]
cmp: [gcc, vs2019, vs2017]
configuration: [default, static, debug, static-debug]
exclude:
- os: windows-2019
cmp: vs2017
- os: windows-2016
cmp: vs2019
steps:
- uses: actions/checkout@v2
- name: Prepare and compile dependencies
run: python cue.py prepare
- name: Build main module (example app)
run: python cue.py build
- name: Run main module tests
run: python cue.py test
- name: Collect and show test results
run: python cue.py test-results
build-rtems:
name: RTEMS${{ matrix.rtems }} / ${{ matrix.configuration }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
CMP: ${{ matrix.cmp }}
BCFG: ${{ matrix.configuration }}
RTEMS: ${{ matrix.rtems }}
APT: re2c g++-mingw-w64-i686 g++-mingw-w64-x86-64 qemu-system-x86
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04]
cmp: [gcc]
configuration: [default, debug]
rtems: ["4.9", "4.10"]
steps:
- uses: actions/checkout@v2
- name: Prepare and compile dependencies
run: python cue.py prepare
- name: Build main module (example app)
run: python cue.py build
- name: Run main module tests
run: python cue.py test
- name: Collect and show test results
run: python cue.py test-results
build-wine:
name: WINE${{ matrix.wine }} / ${{ matrix.configuration }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
CMP: ${{ matrix.cmp }}
BCFG: ${{ matrix.configuration }}
WINE: ${{ matrix.wine }}
APT: re2c g++-mingw-w64-i686 g++-mingw-w64-x86-64
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04]
cmp: [gcc]
configuration: [default, static, debug, static-debug]
wine: [32, 64]
steps:
- uses: actions/checkout@v2
- name: Prepare and compile dependencies
run: python cue.py prepare
- name: Build main module (example app)
run: python cue.py build
- name: Run main module tests
run: python cue.py test
- name: Collect and show test results
run: python cue.py test-results

160
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,160 @@
# .gitlab-ci.yml for testing EPICS Base ci-scripts
# (see: https://github.com/epics-base/ci-scripts)
# Note:
# Paths to scripts are different in this test configuration
# (your module has one more directory level: .ci)
image: ubuntu:bionic
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- .cache/
variables:
GIT_SUBMODULE_STRATEGY: "recursive"
SETUP_PATH: ".:.ci"
BASE_RECURSIVE: "NO"
APT: "libreadline6-dev libncurses5-dev perl clang g++-mingw-w64-i686 g++-mingw-w64-x86-64 qemu-system-x86 re2c"
CMP: "gcc"
BGFC: "default"
VV: "1"
SET: test01
# Unit tests
unit_test:
stage: build
variables:
SET: test00
before_script:
- apt-get update -qq && apt-get install -y -qq make git python curl p7zip-full
- python cue-test.py env
script:
- python cue-test.py
# Template job for test builds (hidden)
.build:
stage: build
before_script:
- apt-get update -qq && apt-get install -y -qq build-essential git python curl p7zip-full
- python cue.py prepare
script:
- python cue.py build
- python cue.py test
- python cue.py test-results
# gcc builds using four configurations (shared/static, optimized/debug)
gcc_default:
extends: .build
gcc_static:
extends: .build
variables:
BCFG: "static"
gcc_debug:
extends: .build
variables:
BCFG: "debug"
gcc_static_debug:
extends: .build
variables:
BCFG: "static-debug"
# clang builds using four configurations (shared/static, optimized/debug)
clang_default:
extends: .build
variables:
CMP: "clang"
clang_static:
extends: .build
variables:
CMP: "clang"
BCFG: "static"
clang_debug:
extends: .build
variables:
CMP: "clang"
BCFG: "debug"
clang_static_debug:
extends: .build
variables:
CMP: "clang"
BCFG: "static-debug"
# WINE based cross-builds to Windows 32bit and 64bit
wine32_default:
extends: .build
variables:
WINE: "32"
wine32_static:
extends: .build
variables:
WINE: "32"
BCFG: "static"
wine32_debug:
extends: .build
variables:
WINE: "32"
BCFG: "debug"
wine32_static_debug:
extends: .build
variables:
WINE: "32"
BCFG: "static-debug"
wine64_default:
extends: .build
variables:
WINE: "64"
wine64_static:
extends: .build
variables:
WINE: "64"
BCFG: "static"
wine64_debug:
extends: .build
variables:
WINE: "64"
BCFG: "debug"
wine64_static_debug:
extends: .build
variables:
WINE: "64"
BCFG: "static-debug"
# Cross-builds to RTEMS 4.9 and 4.10
rtems4.9_default:
extends: .build
variables:
RTEMS: "4.9"
BASE: "3.15"
rtems4.9_debug:
extends: .build
variables:
RTEMS: "4.9"
BASE: "3.15"
BCFG: "debug"
rtems4.10_default:
extends: .build
variables:
RTEMS: "4.10"
rtems4.10_debug:
extends: .build
variables:
RTEMS: "4.10"
BCFG: "debug"

View File

@@ -30,9 +30,11 @@ addons:
- g++-mingw-w64-i686
- g++-mingw-w64-x86-64
- qemu-system-x86
- p7zip-full
homebrew:
packages:
- re2c
- p7zip
update: true
install:
@@ -98,7 +100,7 @@ jobs:
- env: SET=test01 BCFG=static-debug
dist: bionic
- env: SET=test01
- env: SET=test01 CLEAN_DEPS=NO
dist: trusty
- env: SET=test01 BCFG=static-debug
@@ -142,14 +144,10 @@ jobs:
- env: SET=test01 WINE=64 TEST=NO BCFG=static-debug
- env: SET=test01 RTEMS=4.9 BASE=3.15 TEST=NO
- env: SET=test01 RTEMS=4.9 BASE=3.15 TEST=NO BCFG=static
- env: SET=test01 RTEMS=4.9 BASE=3.15 TEST=NO BCFG=debug
- env: SET=test01 RTEMS=4.9 BASE=3.15 TEST=NO BCFG=static-debug
- env: SET=test01 RTEMS=4.10
- env: SET=test01 RTEMS=4.10 BCFG=static
- env: SET=test01 RTEMS=4.10 BCFG=debug
- env: SET=test01 RTEMS=4.10 BCFG=static-debug
- env: SET=test01
os: windows

View File

@@ -1,6 +1,7 @@
<a target="_blank" href="http://semver.org">![Version][badge.version]</a>
<a target="_blank" href="https://travis-ci.org/epics-base/ci-scripts">![Travis status][badge.travis]</a>
<a target="_blank" href="https://ci.appveyor.com/project/epics-base/ci-scripts">![AppVeyor status][badge.appveyor]</a>
<a target="_blank" href="https://github.com/epics-base/ci-scripts/actions">![GitHub Actions status][badge.gh-actions]</a>
# Continuous Integration for EPICS Modules
@@ -56,14 +57,22 @@ levels as the example files.
## Supported CI Services
The listed properties and instructions for the CI services apply to
their free tiers for open source projects, hosted in the cloud on
their infrastructure.
The companies behind these services also offer "enterprise" installations
on customer infrastructure, which will have different performance
and limitations.
### [Travis-CI](https://travis-ci.org/)
- Five parallel runners on Linux/Windows (one runner on MacOS)
- Use different compilers (gcc, clang)
- Use different gcc versions
- Cross-compile for Windows 32bit and 64bit using MinGW and WINE
- Cross-compile for RTEMS 4.9 and 4.10 (Base >= 3.15)
- Ubuntu 12/14/16/18, MacOS 10.13, Windows Server v1809
- Compile natively on Linux (different versions of gcc, clang)
- Compile natively on MacOS (clang)
- Compile natively on Windows (gcc/MinGW, Visual Studio 2017)
- Cross-compile for Windows 32bit and 64bit using MinGW and WINE
- Cross-compile for RTEMS 4.9 and 4.10 (Base >= 3.15)
- Built dependencies are cached (for faster builds).
See specific
@@ -72,8 +81,8 @@ for more details.
### [AppVeyor](https://www.appveyor.com/)
- One parallel runner (all builds are sequential)
- Use different compilers (Visual Studio, gcc/MinGW)
- Use different Visual Studio versions: \
- Windows Server 2012/2016/2019
- Compile using gcc/MinGW or different Visual Studio versions: \
2008, 2010, 2012, 2013, 2015, 2017, 2019
- Compile for Windows 32bit and 64bit
- No useful caching available.
@@ -82,15 +91,44 @@ See specific
**[ci-scripts on AppVeyor README](appveyor/README.md)**
for more details.
### [GitHub Actions](https://github.com/)
- 20 parallel runners on Linux/Windows (5 runners on MacOS)
- Ubuntu 16/18/20, MacOS 10.15, Windows Server 2016/2019
- Compile natively on Linux (gcc, clang)
- Compile natively on MacOS (clang)
- Compile natively on Windows (gcc/MinGW, Visual Studio 2017 & 2019)
- Cross-compile for Windows 32bit and 64bit using MinGW and WINE
- Cross-compile for RTEMS 4.9 and 4.10 (Base >= 3.15)
- Caching not supported by ci-scripts yet.
See specific
**[ci-scripts on GitHub Actions README](github-actions/README.md)**
for more details.
### [GitLab CI/CD](https://gitlab.com/)
- Docker-based runners on Linux (one VM instance per job)
- Can use any Docker image from Dockerhub (the examples use
`ubuntu:bionic`)
- Compile natively using different compilers (gcc, clang)
- Cross-compile for Windows 32bit and 64bit using MinGW and WINE
- Cross-compile for RTEMS 4.9 and 4.10 (Base >= 3.15)
- Built dependencies are cached (for faster builds).
See specific
**[ci-scripts on GitLab CI/CD README](gitlab/README.md)**
for more details.
## How to Use the CI-Scripts
1. Get an account on a supported CI service provider platform.
1. Get an account on a supported CI service provider platform
(e.g. [Travis-CI](https://travis-ci.org/),
[AppVeyor](https://www.appveyor.com/), ...)
[AppVeyor](https://www.appveyor.com/), ...).
GitHub Actions does not require a separate account.
(More details in the specific README of the subdirectory.)
2. In your Support Module, add this ci-scripts repository
2. In your module, add this ci-scripts repository
as a Git Submodule (name suggestion: `.ci`).
```bash
git submodule add https://github.com/epics-base/ci-scripts .ci
@@ -225,10 +263,11 @@ recursing into submodules. [default is including submodules: `YES`]
be always be extended by the release or branch name as `<name>-<version>`.
[default is the slug in lower case: `foo`]
`FOO_HOOK=<script>` Set the name of a script that will be run after cloning
the module, before compiling it. Working directory when running the script
is the root of the targeted module (e.g. `.../.cache/foo-1.2`).
[default: no hooks are run]
`FOO_HOOK=<hook>` Set the name of a `.patch` file, a `.zip` or `.7z` archive
or a script that will be applied (using `-p1`), extracted or run after cloning
the module, before compiling it.
Working directory is the root of the targeted module,
e.g., `.../.cache/foo-1.2`). [default: no hook]
`FOO_VARNAME=<name>` Set the name that is used for the module when creating
the `RELEASE.local` files. [default is the slug in upper case: `FOO`]
@@ -251,6 +290,10 @@ location for the dependency builds. [default is `$HOME/.cache`]
Set `PARALLEL_MAKE` to the number of parallel make jobs that you want your
build to use. [default is the number of CPUs on the runner]
Set `CLEAN_DEPS` to `NO` if you want to leave the object file directories
(`**/O.*`) in the cached dependencies. [default is to run `make clean`
after building a dependency]
Service specific options are described in the README files
in the service specific subdirectories:
@@ -267,6 +310,8 @@ in the service specific subdirectories:
EPICS Modules:
[ASYN](https://github.com/epics-modules/asyn),
[autosave](https://github.com/epics-modules/autosave),
[busy](https://github.com/epics-modules/busy),
[devlib2](https://github.com/epics-modules/devlib2),
[ecmc](https://github.com/epics-modules/ecmc),
[gtest](https://github.com/epics-modules/gtest),
@@ -275,10 +320,14 @@ EPICS Modules:
[MCoreUtils](https://github.com/epics-modules/MCoreUtils),
[modbus](https://github.com/epics-modules/modbus),
[motor](https://github.com/epics-modules/motor),
[mrfioc2](https://github.com/epics-modules/mrfioc2),
[OPCUA](https://github.com/ralphlange/opcua),
[PCAS](https://github.com/epics-modules/pcas),
[softGlueZync](https://github.com/epics-modules/softGlueZynq),
[sscan](https://github.com/epics-modules/sscan),
[vac](https://github.com/epics-modules/vac)
[std](https://github.com/epics-modules/std),
[vac](https://github.com/epics-modules/vac),
[xxx](https://github.com/epics-modules/xxx)
ESS: [EtherCAT MC Motor Driver][ref.ethercatmc]
@@ -338,16 +387,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 3.0.1 of ci-scripts:
setup to release 3.2.0 of ci-scripts:
```bash
cd .ci
git pull origin v3.0.1
git pull origin v3.2.0
cd -
git add .ci
# if needed:
edit .travis.yml # and/or .appveyor.yml
edit .travis.yml # and/or other CI service configurations
git add .travis.yml
git commit -m "Update ci-scripts submodule to v3.0.1"
git commit -m "Update ci-scripts submodule to v3.2.0"
```
Check the example configuration files inside ci-scripts (and their
@@ -401,6 +450,7 @@ in file LICENSE that is included with this distribution.
[badge.version]: https://badge.fury.io/gh/epics-base%2Fci-scripts.svg
[badge.travis]: https://travis-ci.org/epics-base/ci-scripts.svg?branch=master
[badge.appveyor]: https://ci.appveyor.com/api/projects/status/8b578alg974axvux?svg=true
[badge.gh-actions]: https://github.com/epics-base/ci-scripts/workflows/ci-scripts%20build/test/badge.svg
[reddit.bash]: https://www.reddit.com/r/bash/comments/393oqv/why_is_the_version_of_bash_included_in_os_x_so_old/

View File

@@ -3,8 +3,8 @@
## Features
- One parallel runner (all builds are sequential)
- Use different compilers (Visual Studio, gcc/MinGW)
- Use different Visual Studio versions: \
- Windows Server 2012/2016/2019
- Compile using gcc/MinGW or different Visual Studio versions: \
2008, 2010, 2012, 2013, 2015, 2017, 2019
- Compile for Windows 32bit and 64bit
- No useful caching available.
@@ -15,6 +15,10 @@
it to your GitHub account and activate your support module's
repository. For more details, please see below and refer to the
[AppVeyor documentation](https://www.appveyor.com/docs/).
(This applies when using the free tier offered to open source
projects. Things will be different using an "Enterprise"
installation on customer hardware.)
2. Add the ci-scripts respository as a Git Submodule
(see [README](../README.md) one level above).

View File

@@ -22,6 +22,10 @@ if 'TRAVIS' in os.environ:
ci_service = 'travis'
ci_os = os.environ['TRAVIS_OS_NAME']
if 'GITLAB_CI' in os.environ:
ci_service = 'gitlab'
ci_os = 'linux'
if 'APPVEYOR' in os.environ:
ci_service = 'appveyor'
if re.match(r'^Visual', os.environ['APPVEYOR_BUILD_WORKER_IMAGE']):
@@ -31,6 +35,13 @@ if 'APPVEYOR' in os.environ:
elif re.match(r'^macOS', os.environ['APPVEYOR_BUILD_WORKER_IMAGE']):
ci_os = 'osx'
if 'GITHUB_ACTIONS' in os.environ:
ci_service = 'github-actions'
if os.environ['RUNNER_OS'] == 'macOS':
ci_os = 'osx'
else:
ci_os = os.environ['RUNNER_OS'].lower()
def find_in_file(regex, filename):
file = open(filename, "r")
@@ -111,7 +122,7 @@ class TestSourceSet(unittest.TestCase):
class TestUpdateReleaseLocal(unittest.TestCase):
release_local = os.path.join(cue.cachedir, 'RELEASE.local')
release_local = os.path.join(cue.ci['cachedir'], 'RELEASE.local')
def setUp(self):
if os.path.exists(self.release_local):
@@ -179,16 +190,21 @@ class TestUpdateReleaseLocal(unittest.TestCase):
class TestAddDependencyUpToDateCheck(unittest.TestCase):
hash_3_15_6 = "ce7943fb44beb22b453ddcc0bda5398fadf72096"
location = os.path.join(cue.cachedir, 'base-R3.15.6')
licensefile = os.path.join(location, 'LICENSE')
checked_file = os.path.join(location, 'checked_out')
release_file = os.path.join(location, 'configure', 'RELEASE')
location = ''
licensefile = ''
checked_file = ''
release_file = ''
def setUp(self):
os.environ['SETUP_PATH'] = '.:appveyor'
cue.clear_lists()
cue.detect_context()
self.location = os.path.join(cue.ci['cachedir'], 'base-R3.15.6')
self.licensefile = os.path.join(self.location, 'LICENSE')
self.checked_file = os.path.join(self.location, 'checked_out')
self.release_file = os.path.join(self.location, 'configure', 'RELEASE')
if os.path.exists(self.location):
shutil.rmtree(self.location, onerror=cue.remove_readonly)
cue.clear_lists()
os.chdir(builddir)
cue.source_set('defaults')
cue.complete_setup('BASE')
@@ -242,15 +258,18 @@ def is_shallow_repo(place):
class TestAddDependencyOptions(unittest.TestCase):
location = os.path.join(cue.cachedir, 'mcoreutils-master')
testfile = os.path.join(location, '.ci', 'LICENSE')
location = ''
testfile = ''
def setUp(self):
os.environ['SETUP_PATH'] = '.'
if os.path.exists(cue.cachedir):
shutil.rmtree(cue.cachedir, onerror=cue.remove_readonly)
cue.clear_lists()
cue.detect_context()
if os.path.exists(cue.ci['cachedir']):
shutil.rmtree(cue.ci['cachedir'], onerror=cue.remove_readonly)
self.location = os.path.join(cue.ci['cachedir'], 'mcoreutils-master')
self.testfile = os.path.join(self.location, '.ci', 'LICENSE')
os.path.join(cue.ci['cachedir'], 'mcoreutils-master')
cue.source_set('defaults')
cue.complete_setup('MCoreUtils')
cue.setup['MCoreUtils'] = 'master'
@@ -281,7 +300,7 @@ class TestAddDependencyOptions(unittest.TestCase):
def test_AddMsiTo314(self):
cue.complete_setup('BASE')
cue.setup['BASE'] = 'R3.14.12.1'
msifile = os.path.join(cue.cachedir, 'base-R3.14.12.1', 'src', 'dbtools', 'msi.c')
msifile = os.path.join(cue.ci['cachedir'], 'base-R3.14.12.1', 'src', 'dbtools', 'msi.c')
cue.add_dependency('BASE')
self.assertTrue(os.path.exists(msifile), 'MSI was not added to Base 3.14')
@@ -324,8 +343,14 @@ class TestDefaultModuleURLs(unittest.TestCase):
@unittest.skipIf(ci_os != 'windows', 'VCVars test only applies to windows')
class TestVCVars(unittest.TestCase):
def test_vcvars(self):
if ci_service == 'appveyor':
if ci_service == 'travis':
os.environ['TRAVIS_COMPILER'] = 'vs2017'
else:
os.environ['CONFIGURATION'] = 'default'
if ci_service == 'github-actions' and os.environ['IMAGEOS'] == 'win16':
os.environ['CMP'] = 'vs2017'
else:
os.environ['CMP'] = 'vs2019'
cue.detect_context()
cue.with_vcvars('env')
@@ -676,7 +701,10 @@ class TestSetupForBuild(unittest.TestCase):
args = Namespace(paths=[])
cue.building_base = True
if ci_os == 'windows':
sp.check_call(['choco', 'install', 'make'])
choco_installs = ['make']
if ci_service != 'appveyor':
choco_installs.append('strawberryperl')
sp.check_call(['choco', 'install', '-ry'] + choco_installs)
def setUp(self):
if ci_service == 'appveyor':
@@ -726,10 +754,10 @@ class TestSetupForBuild(unittest.TestCase):
@unittest.skipIf(ci_os != 'windows', 'HostArchPlatform test only applies to windows')
def test_HostArchPlatform(self):
if ci_service == 'travis':
platforms = ['x64']
else:
if ci_service == 'appveyor':
platforms = ['x86', 'x64']
else:
platforms = ['x64']
for platform in platforms:
for cc in ['vs2019', 'gcc']:
cue.ci['platform'] = platform
@@ -750,18 +778,17 @@ class TestSetupForBuild(unittest.TestCase):
self.assertTrue(re.search('-mingw$', os.environ['EPICS_HOST_ARCH']),
'EPICS_HOST_ARCH (found {0}) is not -mingw for {1} / {2}'
.format(os.environ['EPICS_HOST_ARCH'], cc, platform))
pattern = {'x86': 'mingw32', 'x64': 'mingw64'}
self.assertTrue(re.search(pattern[platform], os.environ['PATH']),
'Binary location for {0} not in PATH (found {1})'
.format(pattern[platform], os.environ['PATH']))
if ci_service == 'appveyor':
pattern = {'x86': 'mingw32', 'x64': 'mingw64'}
self.assertTrue(re.search(pattern[platform], os.environ['PATH']),
'Binary location for {0} not in PATH (found PATH = {1})'
.format(pattern[platform], os.environ['PATH']))
@unittest.skipIf(ci_os != 'windows', 'Strawberry perl test only applies to windows')
def test_StrawberryInPathVS2019(self):
if 'APPVEYOR' in os.environ:
os.environ['CMP'] = 'vs2019'
def test_StrawberryInPath(self):
cue.setup_for_build(self.args)
self.assertTrue(re.search('strawberry', os.environ['PATH'], flags=re.IGNORECASE),
'Strawberry Perl installed but location not in PATH (found {0})'
'Strawberry Perl location not in PATH (found PATH = {0})'
.format(os.environ['PATH']))
def setBase314(self, yesno):
@@ -817,6 +844,44 @@ class TestSetupForBuild(unittest.TestCase):
'Extra make arg [{0}] not set (expected "bla {0}", found "{1}")'
.format(ind, cue.extra_makeargs[ind]))
class TestHooks(unittest.TestCase):
location = os.path.join(cue.ci['cachedir'], 'hook_test')
bla_file = os.path.join(location, 'bla.txt')
new_file = os.path.join(location, 'dd', 'new.txt')
def setUp(self):
if os.path.exists(self.location):
shutil.rmtree(self.location, onerror=cue.remove_readonly)
try:
os.makedirs(self.location)
except:
pass
with open(self.bla_file, 'w') as f:
f.write('''LINE1=YES
LINE2=NO''')
def test_patchfile(self):
hook = os.path.join(builddir, 'test.patch')
cue.apply_patch(hook, cwd=self.location)
line1_yes = False
with open(self.bla_file) as f:
if 'LINE1=YES' in f.read():
line1_yes = True
self.assertFalse(line1_yes, "Patch didn't change line in test file 'bla.txt'")
self.assertTrue(os.path.exists(self.new_file), "patch didn't add new file")
def test_archiveZip(self):
hook = os.path.join(builddir, 'test.zip')
cue.extract_archive(hook, cwd=self.location)
self.assertTrue(os.path.exists(self.new_file), "archive extract didn't add new file")
def test_archive7z(self):
hook = os.path.join(builddir, 'test.7z')
cue.extract_archive(hook, cwd=self.location)
self.assertTrue(os.path.exists(self.new_file), "archive extract didn't add new file")
if __name__ == "__main__":
if 'VV' in os.environ and os.environ['VV'] == '1':
logging.basicConfig(level=logging.DEBUG)
@@ -827,5 +892,14 @@ if __name__ == "__main__":
if sys.argv[1:] == ['env']:
# testing with_vcvars
[print(K, '=', V) for K, V in os.environ.items()]
elif ci_os == 'windows' and sys.argv[1:] == ['findvs']:
from fnmatch import fnmatch
print('Available Visual Studio versions')
for base in (r'C:\Program Files (x86)', r'C:\Program Files'):
for root, dirs, files in os.walk(base):
for fname in files:
if fnmatch(fname, 'vcvarsall.bat'):
print('Found', os.path.join(root, fname))
sys.stdout.flush()
else:
unittest.main()

269
cue.py
View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python
"""CI build script for Linux/MacOS/Windows on Travis/AppVeyor
"""CI build script for Linux/MacOS/Windows on Travis/AppVeyor/GitHub-Actions
"""
from __future__ import print_function
@@ -16,17 +16,31 @@ logger = logging.getLogger(__name__)
# Detect the service and set up context hash accordingly
def detect_context():
global homedir
buildconfig = 'default'
ci['cachedir'] = os.path.join(homedir, '.cache')
if 'TRAVIS' in os.environ:
ci['service'] = 'travis'
ci['os'] = os.environ['TRAVIS_OS_NAME']
ci['platform'] = 'x64'
ci['compiler'] = os.environ['TRAVIS_COMPILER']
if ci['os'] == 'windows':
ci['choco'] += ['strawberryperl']
if re.match(r'^vs', ci['compiler']):
# Only Visual Studio 2017 available
ci['compiler'] = 'vs2017'
ci['choco'] += ['strawberryperl']
if re.match(r'^vs', ci['compiler']):
# Only Visual Studio 2017 available
ci['compiler'] = 'vs2017'
if 'BCFG' in os.environ:
buildconfig = os.environ['BCFG'].lower()
if 'GITLAB_CI' in os.environ:
ci['service'] = 'gitlab'
ci['os'] = 'linux'
ci['platform'] = 'x64'
ci['sudo'] = [] # No sudo in GitLab Docker containers
ci['cachedir'] = os.path.join(curdir, '.cache') # No caches outside project directory
if 'CMP' in os.environ:
ci['compiler'] = os.environ['CMP']
if 'BCFG' in os.environ:
buildconfig = os.environ['BCFG'].lower()
@@ -43,6 +57,24 @@ def detect_context():
ci['compiler'] = os.environ['CMP']
buildconfig = os.environ['CONFIGURATION'].lower()
if 'GITHUB_ACTIONS' in os.environ:
ci['service'] = 'github-actions'
if os.environ['RUNNER_OS'] == 'macOS':
ci['os'] = 'osx'
else:
ci['os'] = os.environ['RUNNER_OS'].lower()
ci['platform'] = 'x64'
if 'CMP' in os.environ:
ci['compiler'] = os.environ['CMP']
ci['choco'] += ['strawberryperl']
if 'BCFG' in os.environ:
buildconfig = os.environ['BCFG'].lower()
if re.search('static', buildconfig):
ci['static'] = True
if re.search('debug', buildconfig):
ci['debug'] = True
if 'STATIC' in os.environ:
print("{0}WARNING: Variable 'STATIC' not supported anymore; use 'BCFG' instead{1}"
.format(ANSI_RED, ANSI_RESET))
@@ -52,11 +84,6 @@ def detect_context():
.format(ANSI_RED, buildconfig, ANSI_RESET))
sys.stdout.flush()
if re.search('static', buildconfig):
ci['static'] = True
if re.search('debug', buildconfig):
ci['debug'] = True
if ci['static']:
ci['configuration'] = 'static'
else:
@@ -68,9 +95,18 @@ def detect_context():
ci['scriptsdir'] = os.path.abspath(os.path.dirname(sys.argv[0]))
if 'CACHEDIR' in os.environ:
ci['cachedir'] = os.environ['CACHEDIR']
if 'CHOCO' in os.environ:
ci['choco'].extend(os.environ['CHOCO'].split())
if 'APT' in os.environ:
ci['apt'].extend(os.environ['APT'].split())
if 'BREW' in os.environ:
ci['homebrew'].extend(os.environ['BREW'].split())
ci['test'] = True
if 'TEST' in os.environ and os.environ['TEST'].lower() == 'no':
ci['test'] = False
@@ -79,8 +115,14 @@ def detect_context():
if 'PARALLEL_MAKE' in os.environ:
ci['parallel_make'] = os.environ['PARALLEL_MAKE']
logger.debug('Detected a build hosted on %s, using %s on %s (%s) configured as %s (test: %s)',
ci['service'], ci['compiler'], ci['os'], ci['platform'], ci['configuration'], ci['test'])
ci['clean_deps'] = True
if 'CLEAN_DEPS' in os.environ and os.environ['CLEAN_DEPS'].lower() == 'no':
ci['clean_deps'] = False
logger.debug('Detected a build hosted on %s, using %s on %s (%s) configured as %s '
+ '(test: %s, clean_deps: %s)',
ci['service'], ci['compiler'], ci['os'], ci['platform'], ci['configuration'],
ci['test'], ci['clean_deps'])
curdir = os.getcwd()
@@ -97,6 +139,7 @@ is_make3 = False
has_test_results = False
silent_dep_builds = True
do_recompile = False
installed_7z = False
def clear_lists():
@@ -119,7 +162,11 @@ def clear_lists():
ci['debug'] = False
ci['configuration'] = '<unknown>'
ci['scriptsdir'] = ''
ci['cachedir'] = ''
ci['choco'] = ['make']
ci['apt'] = []
ci['homebrew'] = []
ci['sudo'] = ['sudo']
clear_lists()
@@ -143,11 +190,16 @@ ANSI_CLEAR = "\033[0K"
# Travis log fold control
# from https://github.com/travis-ci/travis-rubies/blob/build/build.sh
# GitHub Actions fold control
# from https://github.com/actions/toolkit/blob/master/docs/commands.md#group-and-ungroup-log-lines
def fold_start(tag, title):
if ci['service'] == 'travis':
print('travis_fold:start:{0}{1}{2}{3}'
.format(tag, ANSI_YELLOW, title, ANSI_RESET))
elif ci['service'] == 'github-actions':
print('::group::{0}{1}{2}'
.format(ANSI_YELLOW, title, ANSI_RESET))
elif ci['service'] == 'appveyor':
print('{0}===== \\/ \\/ \\/ ===== START: {1} ====={2}'
.format(ANSI_YELLOW, title, ANSI_RESET))
@@ -158,6 +210,9 @@ def fold_end(tag, title):
if ci['service'] == 'travis':
print('\ntravis_fold:end:{0}\r'
.format(tag), end='')
elif ci['service'] == 'github-actions':
print('::endgroup::'
.format(ANSI_YELLOW, title, ANSI_RESET))
elif ci['service'] == 'appveyor':
print('{0}----- /\\ /\\ /\\ ----- END: {1} -----{2}'
.format(ANSI_YELLOW, title, ANSI_RESET))
@@ -169,18 +224,16 @@ if 'HomeDrive' in os.environ:
homedir = os.path.join(os.getenv('HomeDrive'), os.getenv('HomePath'))
elif 'HOME' in os.environ:
homedir = os.getenv('HOME')
cachedir = os.path.join(homedir, '.cache')
toolsdir = os.path.join(homedir, '.tools')
rtemsdir = os.path.join(homedir, '.rtems')
if 'CACHEDIR' in os.environ:
cachedir = os.environ['CACHEDIR']
rtemsdir = r'/home/travis/.rtems' # Preliminary, until the next generation of toolchain
vcvars_table = {
# https://en.wikipedia.org/wiki/Microsoft_Visual_Studio#History
'vs2019': [r'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat'],
'vs2019': [r'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat',
r'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat'],
'vs2017': [r'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat',
r'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat',
r'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat'],
'vs2015': [r'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat'],
'vs2013': [r'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat'],
@@ -271,9 +324,9 @@ def source_set(name):
setup[assign[0]] = assign[1]
logger.debug('Done with setup file %s', set_file)
break
else:
raise NameError("{0}Setup file {1}.set does not exist in SETUP_PATH search path ({2}){3}"
.format(ANSI_RED, name, setup_dirs, ANSI_RESET))
else:
raise NameError("{0}Setup file {1}.set does not exist in SETUP_PATH search path ({2}){3}"
.format(ANSI_RED, name, setup_dirs, ANSI_RESET))
# update_release_local(var, location)
@@ -285,14 +338,14 @@ def source_set(name):
# - otherwise add "$var=$location" line and possibly move EPICS_BASE=... line to the end
# Set places[var] = location
def update_release_local(var, location):
release_local = os.path.join(cachedir, 'RELEASE.local')
release_local = os.path.join(ci['cachedir'], 'RELEASE.local')
updated_line = '{0}={1}'.format(var, location.replace('\\', '/'))
places[var] = location
if not os.path.exists(release_local):
logger.debug('RELEASE.local does not exist, creating it')
try:
os.makedirs(cachedir)
os.makedirs(ci['cachedir'])
except:
pass
touch = open(release_local, 'w')
@@ -343,7 +396,9 @@ def call_git(args, **kws):
return exitcode
def call_make(args=[], **kws):
def call_make(args=None, **kws):
if args is None:
args = []
place = kws.get('cwd', os.getcwd())
parallel = kws.pop('parallel', ci['parallel_make'])
silent = kws.pop('silent', False)
@@ -367,6 +422,24 @@ def call_make(args=[], **kws):
sys.exit(exitcode)
def apply_patch(file, **kws):
place = kws.get('cwd', os.getcwd())
print('Applying patch {0} in {1}'.format(file, place))
logger.debug("EXEC '%s' in %s", ' '.join(['patch', '-p1', '-i', file]), place)
sys.stdout.flush()
sp.check_call(['patch', '-p1', '-i', file], cwd=place)
logger.debug('EXEC DONE')
def extract_archive(file, **kws):
place = kws.get('cwd', os.getcwd())
print('Extracting archive {0} in {1}'.format(file, place))
logger.debug("EXEC '%s' in %s", ' '.join(['7z', 'x', '-aoa', '-bd', file]), place)
sys.stdout.flush()
sp.check_call(['7z', 'x', '-aoa', '-bd', file], cwd=place)
logger.debug('EXEC DONE')
def get_git_hash(place):
logger.debug("EXEC 'git log -n1 --pretty=format:%%H' in %s", place)
sys.stdout.flush()
@@ -427,7 +500,7 @@ def add_dependency(dep):
.format(ANSI_RED, tag, dep, setup[dep + '_REPOURL'], ANSI_RESET))
dirname = setup[dep + '_DIRNAME'] + '-{0}'.format(tag)
place = os.path.join(cachedir, dirname)
place = os.path.join(ci['cachedir'], dirname)
checked_file = os.path.join(place, "checked_out")
if os.path.isdir(place):
@@ -449,14 +522,14 @@ def add_dependency(dep):
sys.stdout.flush()
if not os.path.isdir(place):
if not os.path.isdir(cachedir):
os.makedirs(cachedir)
if not os.path.isdir(ci['cachedir']):
os.makedirs(ci['cachedir'])
# clone dependency
print('Cloning {0} of dependency {1} into {2}'
.format(tag, dep, place))
sys.stdout.flush()
call_git(['clone', '--quiet'] + deptharg + recursearg + ['--branch', tag, setup[dep + '_REPOURL'], dirname],
cwd=cachedir)
cwd=ci['cachedir'])
sp.check_call(['git', 'log', '-n1'], cwd=place)
logger.debug('Setting do_recompile = True (all following modules will be recompiled')
@@ -479,13 +552,19 @@ def add_dependency(dep):
with open(release, 'w') as fout:
print('-include $(TOP)/../RELEASE.local', file=fout)
# run hook if defined
# Apply HOOK
if dep + '_HOOK' in setup:
hook = os.path.join(place, setup[dep + '_HOOK'])
if os.path.exists(hook):
print('Running hook {0} in {1}'.format(setup[dep + '_HOOK'], place))
sys.stdout.flush()
sp.check_call(hook, shell=True, cwd=place)
hook = setup[dep + '_HOOK']
hook_file = os.path.join(curdir, hook)
if os.path.exists(hook_file):
if re.match(r'.+\.patch$', hook):
apply_patch(hook_file, cwd=place)
elif re.match(r'.+\.(zip|7z)$', hook):
extract_archive(hook_file, cwd=place)
else:
print('Running hook {0} in {1}'.format(hook, place))
sys.stdout.flush()
sp.check_call(hook_file, shell=True, cwd=place)
# write checked out commit hash to marker file
head = get_git_hash(place)
@@ -541,35 +620,37 @@ def setup_for_build(args):
global is_base314, has_test_results, is_make3
dllpaths = []
logger.debug('Setting up the build environment')
if ci['os'] == 'windows':
if ci['service'] == 'appveyor':
if ci['compiler'] == 'vs2019':
# put strawberry perl in the PATH
os.environ['PATH'] = os.pathsep.join([os.path.join(r'C:\Strawberry\perl\site\bin'),
os.path.join(r'C:\Strawberry\perl\bin'),
os.environ['PATH']])
if ci['compiler'] == 'gcc':
if 'INCLUDE' not in os.environ:
os.environ['INCLUDE'] = ''
if ci['platform'] == 'x86':
os.environ['INCLUDE'] = os.pathsep.join(
[r'C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\include',
os.environ['INCLUDE']])
os.environ['PATH'] = os.pathsep.join([r'C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin',
os.environ['PATH']])
elif ci['platform'] == 'x64':
os.environ['INCLUDE'] = os.pathsep.join(
[r'C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\include',
os.environ['INCLUDE']])
os.environ['PATH'] = os.pathsep.join([r'C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin',
os.environ['PATH']])
if ci['service'] == 'travis':
os.environ['PATH'] = os.pathsep.join([r'C:\Strawberry\perl\site\bin', r'C:\Strawberry\perl\bin',
if os.path.exists(r'C:\Strawberry\perl\bin'):
# Put strawberry perl in front of the PATH (so that Git Perl is further behind)
logger.debug('Adding Strawberry Perl in front of the PATH')
os.environ['PATH'] = os.pathsep.join([r'C:\Strawberry\c\bin',
r'C:\Strawberry\perl\site\bin',
r'C:\Strawberry\perl\bin',
os.environ['PATH']])
if ci['service'] == 'appveyor' and ci['compiler'] == 'gcc':
logger.debug('Adding AppVeyor MSYS2/MinGW installation to PATH and INCLUDE')
if 'INCLUDE' not in os.environ:
os.environ['INCLUDE'] = ''
if ci['platform'] == 'x86':
os.environ['INCLUDE'] = os.pathsep.join(
[r'C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\include',
os.environ['INCLUDE']])
os.environ['PATH'] = os.pathsep.join([r'C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin',
os.environ['PATH']])
elif ci['platform'] == 'x64':
os.environ['INCLUDE'] = os.pathsep.join(
[r'C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\include',
os.environ['INCLUDE']])
os.environ['PATH'] = os.pathsep.join([r'C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin',
os.environ['PATH']])
# Find BASE location
if not building_base:
with open(os.path.join(cachedir, 'RELEASE.local'), 'r') as f:
with open(os.path.join(ci['cachedir'], 'RELEASE.local'), 'r') as f:
lines = f.readlines()
for line in lines:
(mod, place) = line.strip().split('=')
@@ -578,11 +659,13 @@ def setup_for_build(args):
else:
places['EPICS_BASE'] = '.'
logger.debug('Using EPICS Base at %s', places['EPICS_BASE'])
detect_epics_host_arch()
if ci['os'] == 'windows':
if not building_base:
with open(os.path.join(cachedir, 'RELEASE.local'), 'r') as f:
with open(os.path.join(ci['cachedir'], 'RELEASE.local'), 'r') as f:
lines = f.readlines()
for line in lines:
(mod, place) = line.strip().split('=')
@@ -601,6 +684,7 @@ def setup_for_build(args):
with open(cfg_base_version) as myfile:
if 'BASE_3_14=YES' in myfile.read():
is_base314 = True
logger.debug('Check if EPICS Base is a 3.14 series: %s', is_base314)
if not is_base314:
rules_build = os.path.join(places['EPICS_BASE'], 'configure', 'RULES_BUILD')
@@ -613,6 +697,7 @@ def setup_for_build(args):
# Check make version
if re.match(r'^GNU Make 3', sp.check_output(['make', '-v']).decode('ascii')):
is_make3 = True
logger.debug('Check if make is a 3.x series: %s', is_make3)
# apparently %CD% is handled automagically
os.environ['TOP'] = os.getcwd()
@@ -634,6 +719,21 @@ def setup_for_build(args):
extra_makeargs.append(os.environ[tag])
def fix_etc_hosts():
# Several travis-ci images throw us a curveball in /etc/hosts
# by including two entries for localhost. The first for 127.0.1.1
# causes epicsSockResolveTest to fail.
# cat /etc/hosts
# ...
# 127.0.1.1 localhost localhost ip4-loopback
# 127.0.0.1 localhost nettuno travis vagrant travis-job-....
logger.debug("EXEC sudo sed -ie '/^127\\.0\\.1\\.1/ s|localhost\\s*||g' /etc/hosts")
sys.stdout.flush()
sp.call(['sudo', 'sed', '-ie', '/^127\\.0\\.1\\.1/ s|localhost\\s*||g', '/etc/hosts'])
logger.debug('EXEC DONE')
def prepare(args):
host_info()
@@ -654,6 +754,9 @@ def prepare(args):
logger.debug('Effective module list: %s', modlist())
if ci['service'] == 'travis' and ci['os'] == 'linux':
fix_etc_hosts()
# we're working with tags (detached heads) a lot: suppress advice
call_git(['config', '--global', 'advice.detachedHead', 'false'])
@@ -666,7 +769,7 @@ def prepare(args):
targetdir = 'configure'
else:
targetdir = '.'
shutil.copy(os.path.join(cachedir, 'RELEASE.local'), targetdir)
shutil.copy(os.path.join(ci['cachedir'], 'RELEASE.local'), targetdir)
fold_end('check.out.dependencies', 'Checking/cloning dependencies')
@@ -791,20 +894,24 @@ CMPLR_CLASS = clang''')
CC = {0}{2}
CCC = {1}{2}'''.format(host_ccmplr_name, host_cppcmplr_name, host_cmplr_ver_suffix))
# Add additional flags to CONFIG_SITE
flags_text = ''
# Add additional settings to CONFIG_SITE
extra_config = ''
if 'USR_CPPFLAGS' in os.environ:
flags_text += '''
extra_config += '''
USR_CPPFLAGS += {0}'''.format(os.environ['USR_CPPFLAGS'])
if 'USR_CFLAGS' in os.environ:
flags_text += '''
extra_config += '''
USR_CFLAGS += {0}'''.format(os.environ['USR_CFLAGS'])
if 'USR_CXXFLAGS' in os.environ:
flags_text += '''
extra_config += '''
USR_CXXFLAGS += {0}'''.format(os.environ['USR_CXXFLAGS'])
if flags_text:
if ci['service'] == 'github-actions' and ci['os'] == 'windows':
extra_config += '''
PERL = C:/Strawberry/perl/bin/perl -CSD'''
if extra_config:
with open(os.path.join(places['EPICS_BASE'], 'configure', 'CONFIG_SITE'), 'a') as f:
f.write(flags_text)
f.write(extra_config)
fold_end('set.up.epics_build', 'Configuring EPICS build system')
@@ -813,9 +920,20 @@ USR_CXXFLAGS += {0}'''.format(os.environ['USR_CXXFLAGS'])
if ci['os'] == 'windows' and ci['choco']:
fold_start('install.choco', 'Installing CHOCO packages')
sp.check_call(['choco', 'install'] + ci['choco'])
sp.check_call(['choco', 'install'] + ci['choco'] + ['-y', '--limitoutput', '--no-progress'])
fold_end('install.choco', 'Installing CHOCO packages')
if ci['os'] == 'linux' and ci['apt']:
fold_start('install.apt', 'Installing APT packages')
sp.check_call(ci['sudo'] + ['apt-get', '-y', 'update'])
sp.check_call(ci['sudo'] + ['apt-get', 'install', '-y', '-qq'] + ci['apt'])
fold_end('install.apt', 'Installing APT packages')
if ci['os'] == 'osx' and ci['homebrew']:
fold_start('install.homebrew', 'Installing Homebrew packages')
sp.check_call(['brew', 'install'] + ci['homebrew'])
fold_end('install.homebrew', 'Installing Homebrew packages')
if ci['os'] == 'linux' and 'RTEMS' in os.environ:
tar_name = 'i386-rtems{0}-trusty-20171203-{0}.tar.bz2'.format(os.environ['RTEMS'])
print('Downloading RTEMS {0} cross compiler: {1}'
@@ -825,7 +943,10 @@ USR_CXXFLAGS += {0}'''.format(os.environ['USR_CXXFLAGS'])
'https://github.com/mdavidsaver/rsb/releases/download/20171203-{0}/{1}'
.format(os.environ['RTEMS'], tar_name)],
cwd=toolsdir)
sp.check_call(['tar', '-C', '/', '-xmj', '-f', os.path.join(toolsdir, tar_name)])
sudo_prefix = []
if ci['service'] == 'github-actions':
sudo_prefix = ['sudo']
sp.check_call(sudo_prefix + ['tar', '-C', '/', '-xmj', '-f', os.path.join(toolsdir, tar_name)])
os.remove(os.path.join(toolsdir, tar_name))
setup_for_build(args)
@@ -854,6 +975,8 @@ USR_CXXFLAGS += {0}'''.format(os.environ['USR_CXXFLAGS'])
place = places[setup[mod + "_VARNAME"]]
print('{0}Building dependency {1} in {2}{3}'.format(ANSI_YELLOW, mod, place, ANSI_RESET))
call_make(cwd=place, silent=silent_dep_builds)
if ci['clean_deps']:
call_make(args=['clean'], cwd=place, silent=silent_dep_builds)
fold_end('build.dependencies', 'Build missing/outdated dependencies')
print('{0}Dependency module information{1}'.format(ANSI_CYAN, ANSI_RESET))
@@ -869,14 +992,14 @@ USR_CXXFLAGS += {0}'''.format(os.environ['USR_CXXFLAGS'])
print("%-10s %-12s %-11s %s" % (mod, setup[mod], stat, commit))
print('{0}Contents of RELEASE.local{1}'.format(ANSI_CYAN, ANSI_RESET))
with open(os.path.join(cachedir, 'RELEASE.local'), 'r') as f:
with open(os.path.join(ci['cachedir'], 'RELEASE.local'), 'r') as f:
print(f.read().strip())
def build(args):
setup_for_build(args)
fold_start('build.module', 'Build the main module')
call_make(args.makeargs)
call_make(args.makeargs, use_extra=True)
fold_end('build.module', 'Build the main module')
@@ -967,7 +1090,7 @@ def getargs():
p.add_argument('--no-vcvars', dest='vcvars', default=True, action='store_false',
help='Assume vcvarsall.bat has already been run')
p.add_argument('--add-path', dest='paths', default=[], action='append',
help='Append directory to %PATH%. Expands {ENVVAR}')
help='Append directory to $PATH or %%PATH%%. Expands {ENVVAR}')
subp = p.add_subparsers()
cmd = subp.add_parser('prepare')

69
github-actions/README.md Normal file
View File

@@ -0,0 +1,69 @@
# GitHub Actions Scripts for EPICS Modules
## Features
- 20 parallel runners on Linux/Windows (5 runners on MacOS)
- Ubuntu 16/18/20, MacOS 10.15, Windows Server 2016/2019
- Compile natively on Linux (gcc, clang)
- Compile natively on MacOS (clang)
- Compile natively on Windows (gcc/MinGW, Visual Studio 2017 & 2019)
- Cross-compile for Windows 32bit and 64bit using MinGW and WINE
- Cross-compile for RTEMS 4.9 and 4.10 (Base >= 3.15)
- Caching not supported yet.
## How to Use these Scripts
1. Add the ci-scripts respository as a Git Submodule
(see [README](../README.md) one level above).
2. Add settings files defining which dependencies in which versions
you want to build against
(see [README](../README.md) one level above).
3. Create a GitHub Actions configuration by copying one of the workflow
examples into the directory `.github/workflows` of your module.
```bash
$ mkdir -p .github/workflows
$ cp .ci/github-actions/ci-scripts-build.yml.example-full .github/workflows/ci-scripts-build.yml
```
4. Edit the workflow configuration to include the build jobs you want
GitHub Actions to run.
Build jobs are specified in the `jobs: <job-name>: strategy:`
declaration. The `matrix:` element specifies the axes as configuration
parameters with their lists of values,
`env:` (on the build level) controls the setting of environment variables
(which can be matrix parameters).
The `runs-on:` setting specifies the image (operating system) of the
runner.
The `name:` is what shows up in the web interface for the workflow,
builds and jobs, and the elements under `steps:` describe the actions
executed for each job of the matrix.
Please check the comments in the examples for more hints, and the
[GitHub Actions documentation](https://help.github.com/en/actions)
for a lot more options and details.
5. Push your changes and click on the `Actions` tab of your GitHub repository
page to see your build results.
## Specifics
#### Quote Environment Variable Values
Variable settings distinguish between numerical and string values.
Better quote all branch and tag names. E.g.,
```yaml
env:
BASE: "7.0"
```
to avoid ci-scripts trying to `git clone` with `--branch 7`.
## Caches
GitHub Actions provides caching of dependencies.
However, since their cache restore and create algorithm is fundamentally
different from those used by Travis and AppVeyor, this will require some
more changes in ci-scripts to work. Be patient.

View File

@@ -0,0 +1,162 @@
# .github/workflows/ci-scripts-build.yml for use with EPICS Base ci-scripts
# (see: https://github.com/epics-base/ci-scripts)
# This is YAML - indentation levels are crucial
# Set the 'name:' properties to values that work for you (MYMODULE)
name: MYMODULE ci-scripts build
# Trigger on pushes and PRs to any branch
on: [push, pull_request]
env:
SETUP_PATH: .ci-local:.ci
CMP: gcc
# For the sequencer on Linux/Windows/MacOS
APT: re2c
CHOCO: re2c
BREW: re2c
jobs:
build-linux:
name: ${{ matrix.cmp }} / ${{ matrix.configuration }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
# Set environment variables from matrix parameters
env:
CMP: ${{ matrix.cmp }}
BCFG: ${{ matrix.configuration }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-18.04, ubuntu-16.04]
cmp: [gcc, clang]
configuration: [default, static, debug, static-debug]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Prepare and compile dependencies
run: python .ci/cue.py prepare
- name: Build main module
run: python .ci/cue.py build
- name: Run main module tests
run: python .ci/cue.py test
- name: Collect and show test results
run: python .ci/cue.py test-results
build-macos:
name: ${{ matrix.cmp }} / ${{ matrix.configuration }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
# Set environment variables from matrix parameters
env:
CMP: ${{ matrix.cmp }}
BCFG: ${{ matrix.configuration }}
strategy:
fail-fast: false
matrix:
os: [macos-10.15]
cmp: [clang]
# No static builds on MacOS
configuration: [default, debug]
steps:
- uses: actions/checkout@v2
- name: Prepare and compile dependencies
run: python .ci/cue.py prepare
- name: Build main module
run: python .ci/cue.py build
- name: Run main module tests
run: python .ci/cue.py test
- name: Collect and show test results
run: python .ci/cue.py test-results
build-windows:
name: ${{ matrix.cmp }} / ${{ matrix.configuration }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
CMP: ${{ matrix.cmp }}
BCFG: ${{ matrix.configuration }}
strategy:
fail-fast: false
matrix:
os: [windows-2019, windows-2016]
cmp: [gcc, vs2019, vs2017]
configuration: [default, static, debug, static-debug]
# Available: vs2017/windows-2016 and vs2019/windows-2019
exclude:
- os: windows-2019
cmp: vs2017
- os: windows-2016
cmp: vs2019
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Prepare and compile dependencies
run: python .ci/cue.py prepare
- name: Build main module
run: python .ci/cue.py build
- name: Run main module tests
run: python .ci/cue.py test
- name: Collect and show test results
run: python .ci/cue.py test-results
# Same setup and toolchain as on Travis.
# Needs Base >= 3.15 to compile, EPICS 7 to also run the tests on qemu
build-rtems:
name: RTEMS${{ matrix.rtems }} / ${{ matrix.configuration }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
CMP: ${{ matrix.cmp }}
BCFG: ${{ matrix.configuration }}
RTEMS: ${{ matrix.rtems }}
APT: re2c g++-mingw-w64-i686 g++-mingw-w64-x86-64 qemu-system-x86
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04]
cmp: [gcc]
configuration: [default, debug]
rtems: ["4.9", "4.10"]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Prepare and compile dependencies
run: python .ci/cue.py prepare
- name: Build main module
run: python .ci/cue.py build
- name: Run main module tests
run: python .ci/cue.py test
- name: Collect and show test results
run: python .ci/cue.py test-results
# The WINE cross builds are of somewhat limited use,
# as there are native gcc/MinGW builds available on GitHub Actions
build-wine:
name: WINE${{ matrix.wine }} / ${{ matrix.configuration }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
CMP: ${{ matrix.cmp }}
BCFG: ${{ matrix.configuration }}
WINE: ${{ matrix.wine }}
APT: re2c g++-mingw-w64-i686 g++-mingw-w64-x86-64
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04]
cmp: [gcc]
configuration: [default, static, debug, static-debug]
wine: [32, 64]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Prepare and compile dependencies
run: python .ci/cue.py prepare
- name: Build main module
run: python .ci/cue.py build
- name: Run main module tests
run: python .ci/cue.py test
- name: Collect and show test results
run: python .ci/cue.py test-results

View File

@@ -0,0 +1,44 @@
# .github/workflows/ci-scripts-build.yml for use with EPICS Base ci-scripts
# (see: https://github.com/epics-base/ci-scripts)
# This is YAML - indentation levels are crucial
# Set the 'name:' properties to values that work for you
name: MYMODULE ci-scripts build
# Trigger on pushes and PRs to any branch
on: [push, pull_request]
env:
SETUP_PATH: .ci-local:.ci
CMP: gcc
jobs:
build-linux:
name: ${{ matrix.base }} / ${{ matrix.cmp }} / ${{ matrix.configuration }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
# Set environment variables from matrix parameters
env:
CMP: ${{ matrix.cmp }}
BCFG: ${{ matrix.configuration }}
BASE: ${{ matrix.base }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-18.04]
cmp: [gcc]
configuration: [default, static]
base: ["7.0", "3.15"]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Prepare and compile dependencies
run: python .ci/cue.py prepare
- name: Build main module
run: python .ci/cue.py build
- name: Run main module tests
run: python .ci/cue.py test
- name: Collect and show test results
run: python .ci/cue.py test-results

View File

@@ -0,0 +1,114 @@
# .gitlab-ci.yml for testing EPICS Base ci-scripts
# (see: https://github.com/epics-base/ci-scripts)
# This is YAML - indentation levels are crucial
# GitLab runner can use any Docker container, we're using this one
# to be comparable with the other CI services
image: ubuntu:bionic
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- .cache/
variables:
GIT_SUBMODULE_STRATEGY: "recursive"
SETUP_PATH: ".ci-local:.ci"
BASE_RECURSIVE: "NO"
# Additional packages needed for
# | EPICS |clang| Windows cross builds |RTEMS testing |sequencer
APT: "libreadline6-dev libncurses5-dev perl clang g++-mingw-w64-i686 g++-mingw-w64-x86-64 qemu-system-x86 re2c"
CMP: "gcc"
BGFC: "default"
# Template for build jobs (hidden)
.build:
stage: build
before_script:
- apt-get update -qq && apt-get install -y -qq build-essential git python curl p7zip-full
- python .ci/cue.py prepare
script:
- python .ci/cue.py build
- python .ci/cue.py test
- python .ci/cue.py test-results
# If you need to do more during install and build,
# add a local directory to your module and do e.g.
# - ./.ci-local/travis/install-extras.sh
# Define build jobs
# Well-known variables to use
# SET source setup file
# ADD_MODULES extra modules (for a specific job)
# BCFG build configuration (static/debug/static-debug;
# default: shared-optimized)
# TEST set to NO to skip running the tests (default: YES)
# VV set to make build scripts verbose (default: unset)
# EXTRA content will be added to make command line
# EXTRA1..5 more additional arguments for the make command
# (one argument per variable)
# Usually from setup files, but may be specified or overridden
# on a job line
# MODULES list of dependency modules
# BASE branch or release tag name of the EPICS Base to use
# <MODULE> branch or release tag for a specific module
# ... see README for setup file syntax description
# Different configurations of gcc and clang
gcc_default:
extends: .build
variables:
BASE: "7.0"
gcc_static:
extends: .build
variables:
BASE: "7.0"
BCFG: "static"
clang_default:
extends: .build
variables:
BASE: "7.0"
CMP: "clang"
clang_static_c++11:
extends: .build
variables:
BASE: "7.0"
CMP: "clang"
BCFG: "static"
EXTRA: "CMD_CXXFLAGS=-std=c++11"
# Cross-compilations to Windows using gcc/MinGW and WINE
wine32_default:
extends: .build
variables:
BASE: "3.15"
BCFG: "static"
WINE: "32"
TEST: "NO"
wine64_debug:
extends: .build
variables:
BASE: "7.0"
BCFG: "debug"
WINE: "64"
# Cross-builds to RTEMS 4.9 and 4.10
rtems4.9_default:
extends: .build
variables:
RTEMS: "4.9"
BASE: "3.15"
rtems4.10_debug:
extends: .build
variables:
RTEMS: "4.10"
BASE: "7.0"
BCFG: "debug"

View File

@@ -0,0 +1,36 @@
# .gitlab-ci.yml for testing EPICS Base ci-scripts
# (see: https://github.com/epics-base/ci-scripts)
image: ubuntu:bionic
variables:
GIT_SUBMODULE_STRATEGY: "recursive"
SETUP_PATH: ".ci-local:.ci"
BASE_RECURSIVE: "NO"
# Minimal set of packages needed to compile EPICS Base
APT: "libreadline6-dev libncurses5-dev perl"
CMP: "gcc"
BGFC: "default"
# Template for build jobs (hidden)
.build:
stage: build
before_script:
- apt-get update -qq && apt-get install -y -qq build-essential git python curl p7zip-full
- python .ci/cue.py prepare
script:
- python .ci/cue.py build
- python .ci/cue.py test
- python .ci/cue.py test-results
# Build on Linux using default gcc for Base branches 7.0 and 3.15
gcc_base_7_0:
extends: .build
variables:
BASE: "7.0"
gcc_base_3_15:
extends: .build
variables:
BASE: "3.15"

68
gitlab/README.md Normal file
View File

@@ -0,0 +1,68 @@
# GitLab CI/CD Scripts for EPICS Modules
## Features
- Docker-based runners on Linux (one VM instance per job)
- Can use any Docker image from Dockerhub (the examples use
`ubuntu:bionic`)
- Compile natively using different compilers (gcc, clang)
- Cross-compile for Windows 32bit and 64bit using MinGW and WINE
- Cross-compile for RTEMS 4.9 and 4.10 (Base >= 3.15)
- Built dependencies are cached (for faster builds).
## How to Use these Scripts
1. Get an account on [GitLab](https://gitlab.com/), create a project
for your support module and have it mirror your upstream GitHub
repository. For more details, please refer to the
[GitLab CI/CD documentation](https://docs.gitlab.com/ee/README.html).
(This applies when using the free tier offered to open source
projects. Things will be different using an "Enterprise"
installation on customer hardware.)
2. Add the ci-scripts respository as a Git Submodule
(see [README](../README.md) one level above).
3. Add settings files defining which dependencies in which versions
you want to build against
(see [README](../README.md) one level above).
4. Create a GitLab configuration by copying one of the examples into
the root directory of your module.
```
$ cp .ci/gitlab/.gitlab-ci.yml.example-full .gitlab-ci.yml
```
5. Edit the `.gitlab-ci.yml` configuration to include the jobs you want
GitLab CI/CD to run.
Build jobs are declared in the list at the end of the file.
Each element (starting with the un-indented line) defines the
settings for one build job. `extends:` specifies a template to use as
a default structure, `variables:` controls the setting of environment
variables (overwriting settings from the template).
Also see the comments in the examples for more hints, and the
[GitLab CI/CD documentation](https://docs.gitlab.com/ee/README.html)
for more options and details.
6. Push your changes to GitHub, wait for the synchronization (every 5min)
and check [GitLab](https://gitlab.com/) for your build results.
## Caches
GitLab is configured to keep the caches separate for different jobs.
However, changing the job description (in the `.gitlab-ci.yml`
configuration file) or its environment settings or changing a value
inside a setup file will _not_ invalidate the cache - you will
have to manually delete the caches through the GitLab web interface.
Caches are automatically removed after approx. four weeks.
Your jobs will have to rebuild them once in a while.
## Miscellanea
To use the feature to extract `.zip`/`.7z` archives by setting
`*_HOOK` variables, the Linux and MacOS runners need the APT package
`p7zip-full` resp. the Homebrew package `p7zip` installed.

BIN
test.7z Normal file

Binary file not shown.

14
test.patch Normal file
View File

@@ -0,0 +1,14 @@
diff -ruN a/bla.txt b/bla.txt
--- a/bla.txt 2020-06-19 18:54:43.129076711 +0200
+++ b/bla.txt 2020-06-19 18:55:05.093948316 +0200
@@ -1,3 +1,3 @@
-LINE1=YES
+LINE1=NO
LINE2=NO
diff -ruN a/dd/new.txt b/dd/new.txt
--- a/dd/new.txt 1970-01-01 01:00:00.000000000 +0100
+++ b/dd/new.txt 2020-06-19 18:55:35.255032413 +0200
@@ -0,0 +1,2 @@
+NEW LINE 1
+NEW LINE 2

BIN
test.zip Normal file

Binary file not shown.

View File

@@ -31,10 +31,14 @@ addons:
- g++-mingw-w64-x86-64
# for RTEMS cross builds
- qemu-system-x86
# for .zip/.7z archive hooks
- p7zip-full
homebrew:
packages:
# for the sequencer
- re2c
# for .zip/.7z archive hooks
- p7zip
update: true
install:

View File

@@ -18,6 +18,10 @@
repository. For more details, please refer to the
[Travis-CI Tutorial](https://docs.travis-ci.com/user/tutorial/).
Make sure to use `travis-ci.org` and not their `.com` site.
(This applies when using the free tier offered to open source
projects. Things will be different using an "Enterprise"
installation on customer hardware.)
2. Add the ci-scripts respository as a Git Submodule
(see [README](../README.md) one level above).
@@ -60,3 +64,9 @@ configuration.)
Caches are automatically removed after approx. four weeks.
Your jobs will have to rebuild them once in a while.
## Miscellanea
To use the feature to extract `.zip`/`.7z` archives by setting
`*_HOOK` variables, the Linux and MacOS runners need the APT package
`p7zip-full` resp. the Homebrew package `p7zip` installed.