Skip to content

Commit 9678580

Browse files
phadejLysxia
authored andcommitted
Test xenial
1 parent 02ee677 commit 9678580

File tree

2 files changed

+167
-1
lines changed

2 files changed

+167
-1
lines changed
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
# This is haskell-ci script on xenial using one GHC
2+
# This way we test a bit older environment
3+
#
4+
name: Haskell-CI Xenial
5+
on:
6+
- push
7+
- pull_request
8+
jobs:
9+
linux:
10+
name: Haskell-CI - Xenial - ${{ matrix.compiler }}
11+
runs-on: ubuntu-18.04
12+
container:
13+
image: buildpack-deps:xenial
14+
continue-on-error: ${{ matrix.allow-failure }}
15+
strategy:
16+
matrix:
17+
include:
18+
- compiler: ghc-8.2.2
19+
compilerKind: ghc
20+
compilerVersion: 8.2.2
21+
setup-method: ghcup
22+
allow-failure: false
23+
fail-fast: false
24+
steps:
25+
- name: apt
26+
run: |
27+
apt-get update
28+
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
29+
mkdir -p "$HOME/.ghcup/bin"
30+
curl -sL https://downloads.haskell.org/ghcup/0.1.17.3/x86_64-linux-ghcup-0.1.17.3 > "$HOME/.ghcup/bin/ghcup"
31+
chmod a+x "$HOME/.ghcup/bin/ghcup"
32+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER"
33+
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0
34+
env:
35+
HCKIND: ${{ matrix.compilerKind }}
36+
HCNAME: ${{ matrix.compiler }}
37+
HCVER: ${{ matrix.compilerVersion }}
38+
- name: Set PATH and environment variables
39+
run: |
40+
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
41+
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
42+
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
43+
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
44+
HCDIR=/opt/$HCKIND/$HCVER
45+
HC=$HOME/.ghcup/bin/$HCKIND-$HCVER
46+
echo "HC=$HC" >> "$GITHUB_ENV"
47+
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
48+
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
49+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
50+
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
51+
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
52+
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
53+
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
54+
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
55+
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
56+
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
57+
env:
58+
HCKIND: ${{ matrix.compilerKind }}
59+
HCNAME: ${{ matrix.compiler }}
60+
HCVER: ${{ matrix.compilerVersion }}
61+
- name: env
62+
run: |
63+
env
64+
- name: write cabal config
65+
run: |
66+
mkdir -p $CABAL_DIR
67+
cat >> $CABAL_CONFIG <<EOF
68+
remote-build-reporting: anonymous
69+
write-ghc-environment-files: never
70+
remote-repo-cache: $CABAL_DIR/packages
71+
logs-dir: $CABAL_DIR/logs
72+
world-file: $CABAL_DIR/world
73+
extra-prog-path: $CABAL_DIR/bin
74+
symlink-bindir: $CABAL_DIR/bin
75+
installdir: $CABAL_DIR/bin
76+
build-summary: $CABAL_DIR/logs/build.log
77+
store-dir: $CABAL_DIR/store
78+
install-dirs user
79+
prefix: $CABAL_DIR
80+
repository hackage.haskell.org
81+
url: http://hackage.haskell.org/
82+
EOF
83+
cat $CABAL_CONFIG
84+
- name: versions
85+
run: |
86+
$HC --version || true
87+
$HC --print-project-git-commit-id || true
88+
$CABAL --version || true
89+
- name: update cabal index
90+
run: |
91+
$CABAL v2-update -v
92+
- name: install cabal-plan
93+
run: |
94+
mkdir -p $HOME/.cabal/bin
95+
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz
96+
echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c -
97+
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
98+
rm -f cabal-plan.xz
99+
chmod a+x $HOME/.cabal/bin/cabal-plan
100+
cabal-plan --version
101+
- name: checkout
102+
uses: actions/checkout@v2
103+
with:
104+
path: source
105+
- name: initial cabal.project for sdist
106+
run: |
107+
touch cabal.project
108+
echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project
109+
cat cabal.project
110+
- name: sdist
111+
run: |
112+
mkdir -p sdist
113+
$CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist
114+
- name: unpack
115+
run: |
116+
mkdir -p unpacked
117+
find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \;
118+
- name: generate cabal.project
119+
run: |
120+
PKGDIR_text="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/text-[0-9.]*')"
121+
echo "PKGDIR_text=${PKGDIR_text}" >> "$GITHUB_ENV"
122+
rm -f cabal.project cabal.project.local
123+
touch cabal.project
124+
touch cabal.project.local
125+
echo "packages: ${PKGDIR_text}" >> cabal.project
126+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package text" >> cabal.project ; fi
127+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
128+
cat >> cabal.project <<EOF
129+
EOF
130+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(text)$/; }' >> cabal.project.local
131+
cat cabal.project
132+
cat cabal.project.local
133+
- name: dump install plan
134+
run: |
135+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
136+
cabal-plan
137+
- name: cache
138+
uses: actions/cache@v2
139+
with:
140+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
141+
path: ~/.cabal/store
142+
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
143+
- name: install dependencies
144+
run: |
145+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
146+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all
147+
- name: build w/o tests
148+
run: |
149+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
150+
- name: build
151+
run: |
152+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
153+
- name: tests
154+
run: |
155+
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
156+
- name: cabal check
157+
run: |
158+
cd ${PKGDIR_text} || false
159+
${CABAL} -vnormal check
160+
- name: haddock
161+
run: |
162+
$CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
163+
- name: unconstrained build
164+
run: |
165+
rm -f cabal.project.local
166+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all

cbits/measure_off.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#endif
1919

2020
bool has_avx512_vl_bw() {
21-
#ifdef __x86_64__
21+
#if defined(__x86_64__) && (__GNUC__ >= 6 || defined(__clang_major__))
2222
uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0;
2323
__get_cpuid_count(7, 0, &eax, &ebx, &ecx, &edx);
2424
// https://en.wikipedia.org/wiki/CPUID#EAX=7,_ECX=0:_Extended_Features

0 commit comments

Comments
 (0)