diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..9116b23 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,83 @@ +on: + push: + branches: + - "main" + pull_request: + workflow_dispatch: + +permissions: + contents: write + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + _VCPKG_: ${{ github.workspace }}/external/microsoft/vcpkg + VCPKG_ROOT: ${{ github.workspace }}/external/microsoft/vcpkg + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" + VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/external/microsoft/vcpkg/bincache + VCPKG_FEATURE_FLAGS: "dependencygraph" + +jobs: + build-test: + runs-on: ubuntu-22.04 + env: + TRIPLET: x64-linux + steps: + - name: Check out repository code + uses: actions/checkout@v4 + with: + submodules: "true" + + - uses: actions/github-script@v6 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: "Create directory '${{ env.VCPKG_DEFAULT_BINARY_CACHE }}'" + run: mkdir -p ${{ github.workspace }}/external/microsoft/vcpkg/bincache + shell: bash + + - uses: lukka/get-cmake@latest + with: + cmakeVersion: "3.29.0" + + - name: Restore vcpkg + uses: actions/cache@v3 + with: + path: | + ${{ env._VCPKG_ }} + !${{ env._VCPKG_ }}/buildtrees + !${{ env._VCPKG_ }}/packages + !${{ env._VCPKG_ }}/downloads + !${{ env._VCPKG_ }}/installed + key: | + ${{ env.TRIPLET }}-${{ hashFiles( '.git/modules/external/microsoft/vcpkg/HEAD' )}} + + - name: Configure + env: + CMAKE_VERBOSE_MAKEFILE: 1 + VCPKG_DEBUG: 1 + run: | + echo "Configuring for triplet ${{ env.TRIPLET }}" + TRIPLET=${{ env.TRIPLET }} make configure + + - name: Upload vcpkg buildtrees + if: always() + uses: actions/upload-artifact@v4 + with: + name: vcpkg-buildtrees-${{ env.TRIPLET }}-${{ github.sha }} + path: external/microsoft/vcpkg/buildtrees/science-scipp + retention-days: 1 + + - name: Build + run: NPROC=1 make build + + - uses: actions/upload-artifact@v4 + with: + name: build-${{ env.TRIPLET }}-${{ github.sha }} + path: build + retention-days: 1 + + - name: Run tests + run: make test + shell: bash \ No newline at end of file diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..8d3bf99 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,18 @@ +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +name: release-please + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: googleapis/release-please-action@v4 + with: + token: ${{ secrets.RELEASE_PLEASE_AT }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..466df71 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.1.0" +} diff --git a/CMakeLists.txt b/CMakeLists.txt index e0e946b..3f668e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,8 @@ cmake_minimum_required(VERSION 3.23.5) -project(synapse VERSION 0.0.1) +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/version.txt" SYNAPSE_CPP_VERSION) +string(STRIP "${SYNAPSE_CPP_VERSION}" SYNAPSE_CPP_VERSION) +project(synapse VERSION ${SYNAPSE_CPP_VERSION}) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/Makefile b/Makefile index 74ae658..7b6b7c1 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +VCPKG_MANIFEST_FEATURES ?= examples\;tests + .PHONY: all all: clean configure build diff --git a/README.md b/README.md index 18add40..f53ec75 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,11 @@ To build: ```sh git submodule update --init + +# Set up vcpkg -- you can also use a vcpkg elsewhere via VCPKG_ROOT cd external/microsoft/vcpkg && ./bootstrap-vcpkg.sh && cd - +export VCPKG_ROOT="$(pwd)/external/microsoft/vcpkg}" + make all # or diff --git a/external/sciencecorp/vcpkg b/external/sciencecorp/vcpkg index 5a626e6..6d9fc95 160000 --- a/external/sciencecorp/vcpkg +++ b/external/sciencecorp/vcpkg @@ -1 +1 @@ -Subproject commit 5a626e6f89f096d20a95a169ca914a9285f33d51 +Subproject commit 6d9fc9518b884eb8e2e627e86862d47f3848fc5e diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..2bf86f1 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,10 @@ +{ + "packages": { + ".": { + "release-type": "simple" + } + }, + "bootstrap-sha": "e255ba2a354554be7b59ad7711aef9695cd34a92", + "always-update": true, + "bump-minor-pre-major": true +} diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..6c6aa7c --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +0.1.0 \ No newline at end of file