2019-04-13 04:50:31 +00:00
|
|
|
version: 2
|
|
|
|
|
|
|
|
jobs:
|
2019-04-13 07:49:31 +00:00
|
|
|
compile:
|
2019-04-13 04:50:31 +00:00
|
|
|
docker:
|
|
|
|
- image: ubuntu:18.04
|
|
|
|
working_directory: ~/nnn
|
|
|
|
environment:
|
|
|
|
CI_FORCE_TEST: 1
|
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
apt update -qq
|
2019-11-22 06:29:14 +00:00
|
|
|
apt install -y --no-install-recommends software-properties-common wget gpg-agent shellcheck
|
2019-06-17 03:13:17 +00:00
|
|
|
apt-add-repository -y ppa:jonathonf/gcc-9.1
|
2019-04-13 06:22:19 +00:00
|
|
|
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|apt-key add -
|
|
|
|
apt-add-repository -y "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-8 main"
|
2019-04-13 05:13:38 +00:00
|
|
|
apt update -qq
|
2019-04-13 06:22:19 +00:00
|
|
|
apt install -y --no-install-recommends git gcc gcc-8 gcc-9 clang clang-8 clang-tidy-8 make pkg-config libncursesw5-dev libreadline-dev
|
2019-04-13 05:13:38 +00:00
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
export CFLAGS=-Werror
|
|
|
|
make clean
|
2019-04-13 06:22:19 +00:00
|
|
|
echo
|
|
|
|
echo "########## gcc ##########"
|
2019-04-13 05:56:19 +00:00
|
|
|
CC=gcc make strip
|
2019-04-13 05:13:38 +00:00
|
|
|
ls -l nnn
|
|
|
|
make clean
|
2019-04-13 06:22:19 +00:00
|
|
|
echo
|
|
|
|
echo "########## gcc-8 ##########"
|
2019-04-13 05:56:19 +00:00
|
|
|
CC=gcc-8 make strip
|
|
|
|
ls -l nnn
|
2019-04-13 05:18:45 +00:00
|
|
|
make clean
|
2019-04-13 06:22:19 +00:00
|
|
|
echo
|
|
|
|
echo "########## gcc-9 ##########"
|
2019-04-13 05:56:19 +00:00
|
|
|
CC=gcc-9 make strip
|
2019-04-13 05:18:45 +00:00
|
|
|
ls -l nnn
|
|
|
|
make clean
|
2019-04-13 06:22:19 +00:00
|
|
|
echo
|
|
|
|
echo "########## clang ##########"
|
|
|
|
CC=clang make strip
|
|
|
|
ls -l nnn
|
|
|
|
make clean
|
|
|
|
echo
|
|
|
|
echo "########## clang-8 ##########"
|
|
|
|
CC=clang-8 make strip
|
|
|
|
ls -l nnn
|
|
|
|
make clean
|
|
|
|
echo
|
|
|
|
echo "########## clang-tidy-8 ##########"
|
|
|
|
clang-tidy-8 src/* -- -I/usr/include -I/usr/include/ncursesw
|
2019-11-22 06:29:14 +00:00
|
|
|
echo "########## checllcheck ##########"
|
|
|
|
find plugins/ -type f -not -name "*.md" -exec shellcheck -e SC1090 {} +
|
2019-04-13 05:18:45 +00:00
|
|
|
|
2019-04-13 04:50:31 +00:00
|
|
|
package-and-publish:
|
|
|
|
machine: true
|
|
|
|
working_directory: ~/nnn
|
|
|
|
steps:
|
2019-04-13 08:12:11 +00:00
|
|
|
- checkout
|
2019-04-13 04:50:31 +00:00
|
|
|
- run:
|
|
|
|
name: "package with packagecore"
|
|
|
|
command: |
|
2019-05-27 14:49:07 +00:00
|
|
|
# Clean up
|
|
|
|
rm -rf ./dist/*
|
|
|
|
# Pack source
|
2020-01-15 12:24:29 +00:00
|
|
|
git archive -o ../${CIRCLE_PROJECT_REPONAME}-${CIRCLE_TAG}.tar.gz --format tar.gz --prefix=${CIRCLE_PROJECT_REPONAME}-${CIRCLE_TAG#v}/ ${CIRCLE_TAG}
|
2019-04-13 04:50:31 +00:00
|
|
|
# Use latest installed python3 from pyenv
|
|
|
|
export PYENV_VERSION="$(pyenv versions | grep -Po '\b3\.\d+\.\d+' | tail -1)"
|
|
|
|
pip install packagecore
|
2019-09-29 02:32:40 +00:00
|
|
|
packagecore -c misc/packagecore/packagecore.yaml -o ./dist/ ${CIRCLE_TAG#v}
|
2019-05-27 14:49:07 +00:00
|
|
|
# Move source pack to dist
|
|
|
|
mv ../${CIRCLE_PROJECT_REPONAME}-${CIRCLE_TAG}.tar.gz dist/
|
|
|
|
|
2019-04-13 04:50:31 +00:00
|
|
|
- run:
|
|
|
|
name: "publish to GitHub"
|
|
|
|
command: |
|
|
|
|
go get github.com/tcnksm/ghr
|
|
|
|
ghr -t ${GITHUB_API_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -replace ${CIRCLE_TAG} ./dist/
|
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
|
|
|
|
test:
|
|
|
|
jobs: &all-tests
|
2019-04-13 07:49:31 +00:00
|
|
|
- compile
|
2019-04-13 04:50:31 +00:00
|
|
|
|
|
|
|
nightly:
|
|
|
|
triggers:
|
|
|
|
- schedule:
|
2019-04-28 05:08:34 +00:00
|
|
|
cron: "0 0 * * 6"
|
2019-04-13 04:50:31 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
jobs: *all-tests
|
|
|
|
|
|
|
|
publish-github-release:
|
|
|
|
jobs:
|
|
|
|
- package-and-publish:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /^v.*/
|
|
|
|
branches:
|
|
|
|
ignore: /.*/
|