From d8a4a1a5aff4d8bba57a98fe1ee7761c18908f4c Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Thu, 9 Mar 2023 15:02:40 -0800 Subject: [PATCH] copy initial setup --- .drone.jsonnet | 51 ++++++++++++++++ .drone/drone.sh | 24 ++++++++ .github/workflows/ci.yml | 118 ++++++++++++++++++++++++++++++++++++ .gitignore | 2 + Jamfile.v2 | 21 +++++++ doc/boost-manual.adoc | 13 ++++ doc/boost-manual/intro.adoc | 7 +++ 7 files changed, 236 insertions(+) create mode 100644 .drone.jsonnet create mode 100644 .drone/drone.sh create mode 100644 .github/workflows/ci.yml create mode 100644 .gitignore create mode 100644 Jamfile.v2 create mode 100644 doc/boost-manual.adoc create mode 100644 doc/boost-manual/intro.adoc diff --git a/.drone.jsonnet b/.drone.jsonnet new file mode 100644 index 0000000..a14838d --- /dev/null +++ b/.drone.jsonnet @@ -0,0 +1,51 @@ +# Copyright 2023 Christian Mazakas +# Distributed under the Boost Software License, Version 1.0. +# https://www.boost.org/LICENSE_1_0.txt + +local triggers = +{ + branch: [ "master", "develop", "feature/*", "bugfix/*", "fix/*", "pr/*", "base-template" ] +}; + +local linux_pipeline(name, image, environment, packages = "", sources = [], arch = "amd64") = +{ + name: name, + kind: "pipeline", + type: "docker", + trigger: triggers, + platform: + { + os: "linux", + arch: arch + }, + steps: + [ + { + name: "everything", + image: image, + environment: environment, + commands: + [ + 'set -e', + 'uname -a', + 'wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -', + ] + + (if sources != [] then [ ('apt-add-repository "' + source + '"') for source in sources ] else []) + + (if packages != "" then [ 'apt-get update', 'apt-get -y install ' + packages ] else []) + + [ + './.drone/drone.sh', + ] + } + ] +}; + +[ + + linux_pipeline( + "Linux 22.04 GCC 11* 32/64", + "cppalliance/droneubuntu2204:1", + {}, + "asciidoctor" + ), + +] diff --git a/.drone/drone.sh b/.drone/drone.sh new file mode 100644 index 0000000..3d0ba26 --- /dev/null +++ b/.drone/drone.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Copyright 2023 Christian Mazakas +# Distributed under the Boost Software License, Version 1.0. +# https://www.boost.org/LICENSE_1_0.txt + +set -ex +export PATH=~/.local/bin:/usr/local/bin:$PATH + +DRONE_BUILD_DIR=$(pwd) + +BOOST_BRANCH=develop +if [ "$DRONE_BRANCH" = "master" ]; then BOOST_BRANCH=master; fi + +cd .. +git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root +cd boost-root +git submodule update --init tools/boostdep +python tools/boostdep/depinst/depinst.py config +./bootstrap.sh +./b2 -d0 headers + +echo 'using asciidoctor : "/usr/bin/asciidoctor" ;' > ~/user-config.jam +./b2 $DRONE_BUILD_DIR diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..56c2796 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,118 @@ +# Copyright 2023 Christian Mazakas +# +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) +--- +name: CI + +on: + pull_request: + push: + branches: + - master + - develop + - bugfix/** + - feature/** + - fix/** + - pr/** + +concurrency: + group: ${{format('{0}:{1}', github.repository, github.ref)}} + cancel-in-progress: true + +env: + NET_RETRY_COUNT: 5 + +jobs: + posix: + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + include: + # Linux, gcc + - { os: ubuntu-22.04, install: 'asciidoctor' } + + timeout-minutes: 180 + runs-on: ${{matrix.os}} + container: ${{matrix.container}} + + steps: + - name: Setup environment + run: | + if [ -f "/etc/debian_version" ]; then + echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV + export DEBIAN_FRONTEND=noninteractive + fi + if [ -n "${{matrix.container}}" ] && [ -f "/etc/debian_version" ]; then + apt-get -o Acquire::Retries=$NET_RETRY_COUNT update + apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common + # Need (newer) git, and the older Ubuntu container may require requesting the key manually using port 80 + apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E1DD270288B4E6030699E45FA1715D88E1DF1F24 + for i in {1..${NET_RETRY_COUNT:-3}}; do sudo -E add-apt-repository -y ppa:git-core/ppa && break || sleep 10; done + apt-get -o Acquire::Retries=$NET_RETRY_COUNT update + apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y g++ python libpython-dev git + fi + + git config --global pack.threads 0 + + - uses: actions/checkout@v3 + with: + # For coverage builds fetch the whole history, else only 1 commit using a 'fake ternary' + fetch-depth: ${{ matrix.coverage && '0' || '1' }} + + - name: Install packages + if: startsWith(matrix.os, 'ubuntu') + run: | + SOURCE_KEYS=(${{join(matrix.source_keys, ' ')}}) + SOURCES=(${{join(matrix.sources, ' ')}}) + # Add this by default + SOURCES+=(ppa:ubuntu-toolchain-r/test) + for key in "${SOURCE_KEYS[@]}"; do + for i in {1..$NET_RETRY_COUNT}; do + wget -O - "$key" | sudo apt-key add - && break || sleep 10 + done + done + for source in "${SOURCES[@]}"; do + for i in {1..$NET_RETRY_COUNT}; do + sudo add-apt-repository $source && break || sleep 10 + done + done + sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update + if [[ -z "${{matrix.install}}" ]]; then + pkgs="${{matrix.compiler}}" + pkgs="${pkgs/gcc-/g++-}" + else + pkgs="${{matrix.install}}" + fi + sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y $pkgs + + - name: Setup Boost + run: | + # Handle also /refs/head/master + if [ "$BOOST_CI_TARGET_BRANCH" == "master" ] || [[ "$BOOST_CI_TARGET_BRANCH" == */master ]]; then + export BOOST_BRANCH="master" + else + export BOOST_BRANCH="develop" + fi + + cd .. + + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + git submodule update -q --init tools/boostdep libs/config + python tools/boostdep/depinst/depinst.py config + ./bootstrap.sh + ./b2 -d0 headers + + echo 'using asciidoctor : "/usr/bin/asciidoctor" ;' > ~/user-config.jam + + - name: Run tests + run: | + cd ../boost-root + ./b2 ${GITHUB_WORKSPACE} + + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..35582c9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +html/** +bin/** \ No newline at end of file diff --git a/Jamfile.v2 b/Jamfile.v2 new file mode 100644 index 0000000..1e89e9e --- /dev/null +++ b/Jamfile.v2 @@ -0,0 +1,21 @@ +# Copyright 2023 Christian Mazakas. +# Distributed under the Boost Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +import asciidoctor ; + +html boost-manual.html : doc/boost-manual.adoc ; + +install html_ : boost-manual.html : html ; + +pdf boost-manual.pdf : doc/boost-manual.adoc ; +explicit boost-manual.pdf ; + +install pdf_ : boost-manual.pdf : pdf ; +explicit pdf_ ; + +############################################################################### +alias boostdoc ; +explicit boostdoc ; +alias boostrelease : html_ ; +explicit boostrelease ; diff --git a/doc/boost-manual.adoc b/doc/boost-manual.adoc new file mode 100644 index 0000000..8abd915 --- /dev/null +++ b/doc/boost-manual.adoc @@ -0,0 +1,13 @@ += Boost Manual +:toc: left +:toclevels: 3 +:idprefix: +:docinfo: private-footer +:source-highlighter: rouge +:source-language: c++ +:nofooter: +:sectlinks: + +:leveloffset: +1 + +include::boost-manual/intro.adoc[] \ No newline at end of file diff --git a/doc/boost-manual/intro.adoc b/doc/boost-manual/intro.adoc new file mode 100644 index 0000000..9cfe30b --- /dev/null +++ b/doc/boost-manual/intro.adoc @@ -0,0 +1,7 @@ +[#intro] += Introduction + +:idprefix: intro_ + +Boost is a collection of peer-reviewed and high-quality libraries that aim to +make application development simple and straight-forward for everyone!