From 091f137ab6516c60812fbd655052f06c5a07aaa7 Mon Sep 17 00:00:00 2001 From: Adrien4193 Date: Wed, 17 Apr 2024 12:07:07 +0200 Subject: [PATCH] BRAYNS-627 use GitHub actions. --- .clang-format | 2 +- .github/workflows/build.yaml | 15 +++++++++++ .github/workflows/linter.yaml | 18 +++++++++++++ .github/workflows/publish-python-client.yml | 28 --------------------- .github/workflows/publish.yaml | 26 +++++++++++++++++++ .gitlab-ci.viz.yml | 19 -------------- .gitlab-ci.yml | 12 --------- .readthedocs.yaml | 6 ++--- 8 files changed, 63 insertions(+), 63 deletions(-) create mode 100644 .github/workflows/build.yaml create mode 100644 .github/workflows/linter.yaml delete mode 100644 .github/workflows/publish-python-client.yml create mode 100644 .github/workflows/publish.yaml delete mode 100644 .gitlab-ci.viz.yml delete mode 100644 .gitlab-ci.yml diff --git a/.clang-format b/.clang-format index 5cbd4e375..149f142e0 100644 --- a/.clang-format +++ b/.clang-format @@ -102,7 +102,7 @@ SpacesInLineCommentPrefix: Maximum: 1 SpacesInParentheses: false SpacesInSquareBrackets: false -Standard: c++17 +Standard: c++20 TabWidth: 4 UseCRLF: false UseTab: Never diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 000000000..8dcf95775 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,15 @@ +name: Build Docker Image + +on: + pull_request: + branches: + - develop + +jobs: + docker-build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Build Docker image + run: docker build -t develop . diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml new file mode 100644 index 000000000..89cf44a90 --- /dev/null +++ b/.github/workflows/linter.yaml @@ -0,0 +1,18 @@ +name: Linter + +on: + pull_request: + branches: + - develop + +jobs: + clang-format-check: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Run clang-format + run: | + apt update && apt install -y clang-format-15 + SOURCES=$(find apps src tests \( -name "*.h" -or -name "*.cpp" \)) + clang-format-15 --dry-run --Werror $SOURCES diff --git a/.github/workflows/publish-python-client.yml b/.github/workflows/publish-python-client.yml deleted file mode 100644 index 2d410111e..000000000 --- a/.github/workflows/publish-python-client.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Publish python client to PyPi - -on: - push: - tags: - - '[0-9]+.[0-9]+.[0-9]+' - -jobs: - build-n-publish: - name: Build and publish on PyPI - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: Set up Python 3.9 - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - name: Build a source tarball - run: | - cd python - python setup.py sdist - - - name: Publish distribution package to PyPI - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} - packages_dir: python/dist/ diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 000000000..9ba0defd4 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,26 @@ +name: Publish + +on: + push: + tags: + - "[0-9]+.[0-9]+.[0-9]+" + +jobs: + build-and-publish: + name: Build and publish on PyPI + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.11 + - name: Build a source tarball + run: | + cd python + python setup.py sdist + - name: Publish distribution package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.gitlab-ci.viz.yml b/.gitlab-ci.viz.yml deleted file mode 100644 index 485ba1016..000000000 --- a/.gitlab-ci.viz.yml +++ /dev/null @@ -1,19 +0,0 @@ -stages: - - test - - publish - -include: - - project: viz/ci/gitlabpipelines - file: index.yml - -ubuntu-clangformat-check: - stage: test - image: - name: ubuntu:22.04 - script: - - apt update && apt install -y git clang-format-15 - - cd $CI_PROJECT_DIR - - SOURCES=$(find apps src tests \( -name "*.h" -or -name "*.cpp" \)) - - clang-format-15 --dry-run --Werror $SOURCES - rules: - - if: $GITHUB_PULL_REQUEST_ID diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 6424059f5..000000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,12 +0,0 @@ -viz_stack: - stage: test - trigger: - include: - - local: .gitlab-ci.viz.yml - strategy: depend - rules: - - if: $CI_EXTERNAL_PULL_REQUEST_IID - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - - if: $CI_COMMIT_TAG - variables: - GITHUB_PULL_REQUEST_ID: $CI_EXTERNAL_PULL_REQUEST_IID diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 8756ef050..22e3fd5b7 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -6,8 +6,8 @@ build: python: "3.9" sphinx: - configuration: python/doc/source/conf.py + configuration: python/doc/source/conf.py python: - install: - - requirements: python/requirements.txt + install: + - requirements: python/requirements.txt