proot/.gitlab-ci.yml

86 lines
2.4 KiB
YAML

image: gcc:7.4.0
stages:
- check
- dist
- coverage
- static-analysis
- deploy
before_script:
- apt-get update -qq
- apt-get install -qq clang-tools-6.0 curl docutils-common gdb lcov libarchive-dev libtalloc-dev strace swig uthash-dev xsltproc
check:
stage: check
script:
- make -C src proot care
- make -C tests
allow_failure: true
dist:
stage: dist
script:
- LDFLAGS="${LDFLAGS} -static" make -C src proot GIT=false
after_script:
- cp src/proot .
artifacts:
paths:
- proot
gcov:
stage: coverage
script:
- make -C src loader.exe loader-m32.exe build.h
- CFLAGS='-Wall -Werror -O0 --coverage' LDFLAGS='-ltalloc -Wl,-z,noexecstack --coverage' make -eC src proot care
- make -C tests || true # ignore failing tests (for now)
- lcov --capture --directory src --output-file coverage.info
- genhtml coverage.info --output-directory gcov-latest
artifacts:
paths:
- gcov-latest
scan-build:
stage: static-analysis
script:
- scan-build-6.0 make -C src proot
after_script:
- cp -R /tmp/scan-build-* scan-build-latest
artifacts:
paths:
- scan-build-latest
pages:
stage: deploy
script:
- mkdir -p public/{bin,reports}
- mkdir -p public/reports/{lcov,scan-build}
- cp proot public/bin/proot
- cp doc/template/redirect.html public/index.html
- cp -R gcov-latest public/reports/
- cp -R scan-build-latest public/reports/
- cp public/index.html public/reports/scan-build/
- cp public/index.html public/reports/lcov/
- sed -i "s|{{ page.source_url }}|https://proot-me.github.io|g" public/index.html
- sed -i "s|{{ page.source_url }}|https://proot.gitlab.io/-/proot/-/jobs/${CI_JOB_ID}/artifacts/public/reports/scan-build-latest/index.html|g" public/reports/scan-build/index.html
- sed -i "s|{{ page.source_url }}|https://proot.gitlab.io/-/proot/-/jobs/${CI_JOB_ID}/artifacts/public/reports/gcov-latest/index.html|g" public/reports/lcov/index.html
dependencies:
- dist
- gcov
- scan-build
artifacts:
paths:
- public
site:
stage: deploy
script:
- git config --global user.name "PRoot"
- git config --global user.email "proot_me@googlegroups.com"
- git clone https://${GITHUB_USER}:${GITHUB_ACCESS_TOKEN}@github.com/proot-me/proot-me.github.io doc/public_html
- make -eC doc dist
- cd doc/public_html && git add . && git commit -m "publishing changes to GitHub Pages" && git push
only:
- master