-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from justusranvier/develop
setup actions
- Loading branch information
Showing
12 changed files
with
343 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: compile | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
|
||
jobs: | ||
compile: | ||
name: ${{ matrix.toolchain }}-${{ matrix.preset }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
toolchain: [gcc, clang] | ||
preset: [default] | ||
include: | ||
- toolchain: gcc | ||
docker: 1.189.0 | ||
compiler: gcc | ||
- toolchain: clang | ||
docker: 1.189.0 | ||
compiler: clang | ||
steps: | ||
- name: Checkout opentxs | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: '0' | ||
submodules: 'recursive' | ||
- name: Get more disk space | ||
run: | | ||
sudo rm -rf "/usr/local/lib/android" | ||
sudo rm -rf "${JAVA_HOME_8_X64}" | ||
sudo rm -rf "${JAVA_HOME_11_X64}" | ||
shell: bash | ||
continue-on-error: true | ||
- name: Cache Docker images | ||
uses: ScribeMD/[email protected] | ||
with: | ||
key: docker-ci-${{ matrix.docker }} | ||
- name: Setup build environment | ||
run: | | ||
docker pull opentransactions/downstream-ci:${{ matrix.docker }} | ||
- name: Compile | ||
run: | | ||
mkdir -p /tmp/opentxs | ||
docker run --mount type=bind,src=${{ github.workspace }},dst=/usr/src/ --mount type=bind,src=/tmp/opentxs,dst=/home/output -i opentransactions/downstream-ci:${{ matrix.docker }} /usr/src/ ${{ matrix.compiler }} ${{ matrix.preset }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: format | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
|
||
jobs: | ||
format: | ||
name: clang-format | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
env: | ||
docker: '1.189.0' | ||
steps: | ||
- name: Checkout opentxs | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: '0' | ||
submodules: 'recursive' | ||
- name: Cache Docker images | ||
uses: ScribeMD/[email protected] | ||
with: | ||
key: docker-ci-${{ matrix.docker }} | ||
- name: Setup build environment | ||
run: | | ||
docker pull opentransactions/downstream-ci:${{ env.docker }} | ||
- name: Check formatting | ||
run: | | ||
mkdir -p /tmp/opentxs | ||
docker run --read-only --mount type=bind,src=${{ github.workspace }},dst=/home/src -i --entrypoint /usr/bin/check-formatting.sh opentransactions/downstream-ci:${{ env.docker }} /home/src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: iwyu | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
|
||
jobs: | ||
includes: | ||
name: include-what-you-use | ||
runs-on: ubuntu-22.04-large64 | ||
strategy: | ||
fail-fast: true | ||
env: | ||
docker: '1.189.0' | ||
steps: | ||
- name: Checkout opentxs | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: '0' | ||
submodules: 'recursive' | ||
- name: Cache Docker images | ||
uses: ScribeMD/[email protected] | ||
with: | ||
key: docker-ci-${{ matrix.docker }} | ||
- name: Setup build environment | ||
run: | | ||
docker pull opentransactions/downstream-ci:${{ env.docker }} | ||
- name: Check includes | ||
run: | | ||
mkdir -p /tmp/opentxs | ||
docker run --mount type=bind,src=${{ github.workspace }},dst=/usr/src/ --mount type=bind,src=/tmp/opentxs,dst=/home/output -i --entrypoint /usr/bin/run-iwyu.sh opentransactions/downstream-ci:${{ env.docker }} /usr/src/ iwyu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
{ | ||
"version": 6, | ||
"cmakeMinimumRequired": { | ||
"major": 3, | ||
"minor": 26, | ||
"patch": 0 | ||
}, | ||
"configurePresets": [ | ||
{ | ||
"name": "mode-debug", | ||
"hidden": true, | ||
"cacheVariables": { | ||
"CMAKE_BUILD_TYPE": "Debug" | ||
} | ||
}, | ||
{ | ||
"name": "mode-release", | ||
"hidden": true, | ||
"cacheVariables": { | ||
"CMAKE_BUILD_TYPE": "Release" | ||
} | ||
}, | ||
{ | ||
"name": "default", | ||
"displayName": "Default", | ||
"description": "Default build using Ninja generator", | ||
"generator": "Ninja", | ||
"inherits": "mode-debug", | ||
"binaryDir": "${sourceDir}/build/${presetName}", | ||
"cacheVariables": { | ||
"CMAKE_UNITY_BUILD": "ON" | ||
} | ||
}, | ||
{ | ||
"name": "iwyu", | ||
"displayName": "iwyu", | ||
"description": "configure build for include-what-you-use ci check", | ||
"inherits": "default", | ||
"cacheVariables": { | ||
"CMAKE_C_COMPILER": "clang", | ||
"CMAKE_CXX_COMPILER": "clang++", | ||
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON", | ||
"OPENTXS_NOTARY_PEDANTIC_BUILD": "OFF", | ||
"OPENTXS_NOTARY_IWYU": "ON", | ||
"CMAKE_UNITY_BUILD": "OFF" | ||
} | ||
} | ||
], | ||
"buildPresets": [ | ||
{ | ||
"hidden": true, | ||
"name": "ninja", | ||
"nativeToolOptions": [ | ||
"-k 0" | ||
] | ||
}, | ||
{ | ||
"name": "default", | ||
"configurePreset": "default", | ||
"inherits": [ | ||
"ninja" | ||
] | ||
}, | ||
{ | ||
"name": "iwyu", | ||
"configurePreset": "iwyu", | ||
"inherits": [ | ||
"ninja" | ||
] | ||
} | ||
], | ||
"workflowPresets": [ | ||
{ | ||
"name": "default", | ||
"steps": [ | ||
{ | ||
"type": "configure", | ||
"name": "default" | ||
}, | ||
{ | ||
"type": "build", | ||
"name": "default" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "iwyu", | ||
"steps": [ | ||
{ | ||
"type": "configure", | ||
"name": "iwyu" | ||
}, | ||
{ | ||
"type": "build", | ||
"name": "iwyu" | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
ARG OPENTXS_SDK | ||
ARG OPENTXS_VERSION | ||
ARG SDK="${OPENTXS_SDK}:${OPENTXS_VERSION}" | ||
|
||
FROM ${SDK} AS compile | ||
COPY --from=metier-server-download /usr/src/metier-server /usr/src/metier-server | ||
RUN --mount=type=tmpfs,target=/tmp/metier-server /opt/cmake/bin/cmake \ | ||
-S /usr/src/metier-server \ | ||
-B /tmp/metier-server \ | ||
-GNinja \ | ||
-DCMAKE_INSTALL_PREFIX=/opt/metier-server \ | ||
-DCMAKE_C_FLAGS="-O2" \ | ||
-DCMAKE_CXX_FLAGS="-O2" \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_UNITY_BUILD=ON \ | ||
-DCMAKE_UNITY_BUILD_BATCH_SIZE=0 \ | ||
&& /opt/cmake/bin/cmake --build /tmp/metier-server \ | ||
&& /opt/cmake/bin/cmake --install /tmp/metier-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
variable "tag" { default = "23.3.2" } | ||
variable "opentxs" { default = "1.189.0" } | ||
|
||
variable "target_arch" { | ||
default = "amd64" | ||
} | ||
variable "repo" { | ||
default = "https://github.com/Open-Transactions/metier-server" | ||
} | ||
|
||
variable "sdk" { | ||
default = "opentransactions/alpine-sdk" | ||
} | ||
|
||
variable "runtime" { | ||
default = "opentransactions/alpine-runtime" | ||
} | ||
|
||
target "downloader" { | ||
dockerfile = "downloader" | ||
target = "downloader" | ||
tags = [ | ||
"temp-metier-server/downloader" | ||
] | ||
} | ||
|
||
target "metier-server-download" { | ||
dockerfile = "download" | ||
target = "metier-server-download" | ||
contexts = { | ||
download = "target:downloader" | ||
} | ||
args = { | ||
METIER_SERVER_REPO = "${repo}" | ||
METIER_SERVER_TAG = "${tag}" | ||
} | ||
tags = [ | ||
"temp-metier-server/metier-server-download" | ||
] | ||
} | ||
|
||
target "compile" { | ||
dockerfile = "compile" | ||
target = "compile" | ||
contexts = { | ||
metier-server-download = "target:metier-server-download" | ||
} | ||
args = { | ||
OPENTXS_SDK = "${sdk}" | ||
OPENTXS_VERSION = "${opentxs}" | ||
} | ||
tags = [ | ||
"temp-metier-server/compile" | ||
] | ||
} | ||
|
||
target "default" { | ||
dockerfile = "run" | ||
target = "run" | ||
contexts = { | ||
compile = "target:compile" | ||
} | ||
args = { | ||
OPENTXS_RUNTIME = "${runtime}" | ||
OPENTXS_VERSION = "${opentxs}" | ||
} | ||
tags = [ | ||
"opentransactions/notary:${tag}-${opentxs}-${target_arch}", | ||
"opentransactions/notary:latest-${target_arch}" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM download AS metier-server-download | ||
ARG METIER_SERVER_REPO | ||
ARG METIER_SERVER_TAG | ||
|
||
RUN --mount=type=tmpfs,target=/tmp/download/ cd /tmp/download \ | ||
&& wget -O /tmp/download/metier-server.tar.gz "${METIER_SERVER_REPO}/archive/refs/tags/${METIER_SERVER_TAG}.tar.gz" \ | ||
&& tar -xf metier-server.tar.gz \ | ||
&& mv "metier-server-${METIER_SERVER_TAG}" /usr/src/metier-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
ARG DOWNLOAD_UBUNTU_VERSION="22.04" | ||
|
||
FROM ubuntu:${DOWNLOAD_UBUNTU_VERSION} AS downloader | ||
RUN mkdir -p /usr/src | ||
RUN --mount=type=tmpfs,target=/var/lib/apt/lists apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get -qq install \ | ||
bzip2 \ | ||
git \ | ||
lzop \ | ||
p7zip \ | ||
rsync \ | ||
unzip \ | ||
wget \ | ||
xz-utils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
ARG OPENTXS_RUNTIME | ||
ARG OPENTXS_VERSION | ||
ARG RUNTIME="${OPENTXS_RUNTIME}:${OPENTXS_VERSION}" | ||
|
||
FROM ${RUNTIME} AS run | ||
COPY --from=compile /opt/metier-server /usr | ||
ENTRYPOINT [ "/usr/bin/metier-server", "--ot_home=/srv/metier-server" ] | ||
CMD [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[ | ||
{ "include": ["@<boost/program_options/.*>", "private", "<boost/program_options.hpp>", "public"] }, | ||
{ "symbol": ["__forced_unwind", "private", "<stdexcept>", "public"] }, | ||
{ "symbol": ["int8_t", "private", "<cstdint>", "public"] }, | ||
{ "symbol": ["uint8_t", "private", "<cstdint>", "public"] }, | ||
{ "symbol": ["int16_t", "private", "<cstdint>", "public"] }, | ||
{ "symbol": ["uint16_t", "private", "<cstdint>", "public"] }, | ||
{ "symbol": ["int32_t", "private", "<cstdint>", "public"] }, | ||
{ "symbol": ["uint32_t", "private", "<cstdint>", "public"] }, | ||
{ "symbol": ["int64_t", "private", "<cstdint>", "public"] }, | ||
{ "symbol": ["uint64_t", "private", "<cstdint>", "public"] }, | ||
] |