mirror of
https://github.com/jarun/nnn.git
synced 2024-11-01 00:47:18 +00:00
111 lines
3.4 KiB
YAML
111 lines
3.4 KiB
YAML
version: 2
|
|
|
|
jobs:
|
|
compile:
|
|
docker:
|
|
- image: ubuntu:18.04
|
|
working_directory: ~/nnn
|
|
environment:
|
|
CI_FORCE_TEST: 1
|
|
steps:
|
|
- run:
|
|
command: |
|
|
apt update -qq
|
|
apt install -y --no-install-recommends software-properties-common wget gpg-agent shellcheck
|
|
apt-add-repository -y ppa:jonathonf/gcc-9.1
|
|
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"
|
|
apt update -qq
|
|
apt install -y --no-install-recommends git gcc gcc-8 gcc-9 clang clang-8 clang-9 clang-tidy-9 make pkg-config libncursesw5-dev libreadline-dev
|
|
- checkout
|
|
- run:
|
|
command: |
|
|
export CFLAGS=-Werror
|
|
make clean
|
|
echo
|
|
echo "########## gcc ##########"
|
|
CC=gcc make strip
|
|
ls -l nnn
|
|
make clean
|
|
echo
|
|
echo "########## gcc-8 ##########"
|
|
CC=gcc-8 make strip
|
|
ls -l nnn
|
|
make clean
|
|
echo
|
|
echo "########## gcc-9 ##########"
|
|
CC=gcc-9 make strip
|
|
ls -l nnn
|
|
make clean
|
|
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-9 ##########"
|
|
CC=clang-9 make strip
|
|
ls -l nnn
|
|
make clean
|
|
echo
|
|
echo "########## clang-tidy-9 ##########"
|
|
clang-tidy-9 src/* -- -I/usr/include -I/usr/include/ncursesw
|
|
echo "########## checllcheck ##########"
|
|
find plugins/ -type f -not -name "*.md" -exec shellcheck -e SC1090 {} +
|
|
|
|
package-and-publish:
|
|
machine: true
|
|
working_directory: ~/nnn
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: "package with packagecore"
|
|
command: |
|
|
# Clean up
|
|
rm -rf ./dist/*
|
|
# Pack source
|
|
git archive -o ../${CIRCLE_PROJECT_REPONAME}-${CIRCLE_TAG}.tar.gz --format tar.gz --prefix=${CIRCLE_PROJECT_REPONAME}-${CIRCLE_TAG#v}/ ${CIRCLE_TAG}
|
|
# Use latest installed python3 from pyenv
|
|
export PYENV_VERSION="$(pyenv versions | grep -Po '\b3\.\d+\.\d+' | tail -1)"
|
|
pip install packagecore
|
|
packagecore -c misc/packagecore/packagecore.yaml -o ./dist/ ${CIRCLE_TAG#v}
|
|
# Move source pack to dist
|
|
mv ../${CIRCLE_PROJECT_REPONAME}-${CIRCLE_TAG}.tar.gz dist/
|
|
|
|
- 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
|
|
- compile
|
|
|
|
nightly:
|
|
triggers:
|
|
- schedule:
|
|
cron: "0 0 * * 6"
|
|
filters:
|
|
branches:
|
|
only:
|
|
- master
|
|
jobs: *all-tests
|
|
|
|
publish-github-release:
|
|
jobs:
|
|
- package-and-publish:
|
|
filters:
|
|
tags:
|
|
only: /^v.*/
|
|
branches:
|
|
ignore: /.*/
|