-
Notifications
You must be signed in to change notification settings - Fork 6
156 lines (144 loc) · 6.28 KB
/
c-cpp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: github action build & CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
tags:
description: 'Test scenario tags'
jobs:
gapc_ubuntu:
needs: cpplint
strategy:
matrix:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
# as of 21st Sep 2021, ubuntu-16.04 is no longer supported by github actions: https://github.blog/changelog/2021-04-29-github-actions-ubuntu-16-04-lts-virtual-environment-will-be-removed-on-september-20-2021/
# 18.04 burnout: https://github.com/actions/runner-images/issues/6002
os: [ubuntu-20.04, ubuntu-22.04]
plattform: ["linux", "linux/amd64"]
runs-on: ${{ matrix.os }}
steps:
- name: Update apt
run: sudo apt-get update
- name: Install dependencies
run: sudo apt-get install flex bison make libboost-all-dev libgsl-dev python3 python3-pip
- name: Checkout truth
run: git clone --branch master https://github.com/jlab/gapc-test-suite.git $GITHUB_WORKSPACE/../gapc-test-suite
- uses: actions/checkout@v3
- name: configure
run: ./configure --prefix $GITHUB_WORKSPACE
- name: make
run: make -j 2
- name: make install
run: sudo make install
- name: test-mod
run: make test-mod TRUTH_DIR=$GITHUB_WORKSPACE/../gapc-test-suite/Truth TRUTH_SUFFIX=_ubuntu
- name: test-mod_outside
run: make -j 2 test-mod_outside TRUTH_DIR=$GITHUB_WORKSPACE/../gapc-test-suite/Truth TRUTH_SUFFIX=_ubuntu
- name: test-regress
run: make test-regress TRUTH_DIR=$GITHUB_WORKSPACE/../gapc-test-suite/Truth
- name: test-ambiguity
run: make test-ambiguity TRUTH_DIR=$GITHUB_WORKSPACE/../gapc-test-suite/Truth
- name: test-unit
run: make test-unit
# we need to install Haskell (especially the System.Random lib) for paralell tests, since we compare Haskell ADP with gapc
- uses: haskell-actions/setup@v2
with:
cabal-version: '3.6.2.0' # pin version on 2023-02-09 to enable proper cabal installtion
id: haskell
- name: cabal
run: |
${{ steps.haskell.outputs.cabal-exe }} v2-update
${{ steps.haskell.outputs.cabal-exe }} v2-install --lib random
- name: test-paral
run: |
package_path=$HOME/.cabal/store/ghc-`${{ steps.haskell.outputs.ghc-exe }} --version | rev | cut -d " " -f 1 | rev`/package.db
GHC="ghc -package-db $package_path" make test-paral
gapc_osx:
needs: cpplint
strategy:
matrix:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
os: [macos-12]
runs-on: ${{ matrix.os }}
steps:
- name: Install dependencies
run: brew install [email protected] cmake boost gsl gnu-sed libomp gmp cabal-install ghc
- name: update cabal
run: cabal update
- name: add random Haskell lib
run: cabal install --lib random
#- name: add base Haskell lib containers (prelude, Data.Map, Data.Map.Strict)
# run: cabal install --lib base
- name: Checkout truth
run: git clone --branch master https://github.com/jlab/gapc-test-suite.git $GITHUB_WORKSPACE/../gapc-test-suite
- uses: actions/checkout@v3
- name: configure
run: ./configure --prefix $GITHUB_WORKSPACE
- name: patch configuration for OSX
run: gsed -E "s|^YACC = .+$|YACC = /usr/local/opt/[email protected]/bin/bison|" -i config.mf && gsed -E "s|^SED = .+$|SED = /usr/local/opt/gnu-sed/libexec/gnubin/sed|" -i config.mf && gsed -E "s/ -D_XOPEN_SOURCE=500 / /" -i config.mf && gsed -E "s/ -std=c\+\+17 / -std=c\+\+11 /" -i config.mf
- name: make
run: make -j 3
- name: make install
run: sudo make install
- name: test-mod
run: make test-mod TRUTH_DIR=$GITHUB_WORKSPACE/../gapc-test-suite/Truth TRUTH_SUFFIX=_osx
- name: test-mod_outside
run: make -j 2 test-mod_outside TRUTH_DIR=$GITHUB_WORKSPACE/../gapc-test-suite/Truth TRUTH_SUFFIX=_osx
- name: test-regress
run: make test-regress TRUTH_DIR=$GITHUB_WORKSPACE/../gapc-test-suite/Truth
- name: test-ambiguity
run: make test-ambiguity TRUTH_DIR=$GITHUB_WORKSPACE/../gapc-test-suite/Truth
- name: test-unit
run: make test-unit
- name: test-paral
run: make test-paral
fold-grammars:
needs: cpplint
strategy:
matrix:
task: [default, shapes, pkiss, alishapes, palikiss, knotinframe]
runs-on: ubuntu-latest
steps:
# install gapcs
- name: Update apt
run: sudo apt-get update
- name: Install dependencies
run: sudo apt-get install flex bison make libboost-all-dev libgsl-dev python3 python3-pip python3-biopython
- uses: actions/checkout@v3
- name: configure
run: ./configure
- name: make
run: make -j 2
- name: make install
run: sudo make install
- name: clone fold-grammars
run: git clone --branch master https://github.com/jlab/fold-grammars.git $GITHUB_WORKSPACE/../fold-grammars
- name: configure fold-grammars
run: |
cd $GITHUB_WORKSPACE/../fold-grammars
sed -i "s#bgapDir = '/vol/gapc/'#bgapDir = '/usr/local/'#" Misc/Applications/lib/foldGrammars/Settings.pm
sed -i "s#rootDir = '/vol/fold-grammars/src/'#rootDir = '`pwd`/'#" Misc/Applications/lib/foldGrammars/Settings.pm
- name: execute tests
run: |
cd $GITHUB_WORKSPACE/../fold-grammars
if [[ "${{ matrix.task }}" == "default" ]]; then pushd .; cd Misc/Test-Suite/GeorgStyle/; bash run.sh ../Truth; cd ../StefanStyle/; python test_cofold.py; popd; fi
pushd .
cd Misc/Test-Suite/StefanStyle/
perl runTests.pl 2 ${{ matrix.task }}
popd
cpplint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- run: pip install cpplint
- run: cpplint --recursive --counting 'detailed' --filter="-runtime/references,-build/include_subdir" --extensions=cc,hh src/ rtlib/
- run: cpplint --counting 'detailed' --filter="-build/include_subdir,-readability/casting,-runtime/arrays" --extensions=c,h librna/rnalib.{c,h}
- run: cpplint --recursive --counting 'detailed' --filter="-runtime/references,-build/include_subdir" testdata/unittest/*