From 6df7e22e2661838170932ad713a1a42b61a08688 Mon Sep 17 00:00:00 2001 From: Steph Prince <40640337+stephprince@users.noreply.github.com> Date: Mon, 1 Apr 2024 11:12:44 -0700 Subject: [PATCH] update gh workflows --- .github/workflows/codespell.yml | 21 +++++++++ .github/workflows/lint.yml | 21 +++++++++ .github/workflows/{ci.yml => tests.yml} | 62 ++++++++++++++----------- 3 files changed, 76 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/codespell.yml create mode 100644 .github/workflows/lint.yml rename .github/workflows/{ci.yml => tests.yml} (50%) diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 00000000..2648f684 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,21 @@ +name: Codespell + +on: + push: + branches: + - main + + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Codespell + uses: codespell-project/actions-codespell@v2 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..87149c11 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,21 @@ +name: Linter + +on: + push: + branches: + - main + + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + lint: + name: Run linter + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Lint + run: cmake -D FORMAT_COMMAND=clang-format-14 -P cmake/lint.cmake diff --git a/.github/workflows/ci.yml b/.github/workflows/tests.yml similarity index 50% rename from .github/workflows/ci.yml rename to .github/workflows/tests.yml index 84234a19..4d07d482 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: Continuous Integration +name: Run tests on: push: @@ -11,39 +11,45 @@ on: workflow_dispatch: jobs: - lint: - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-python@v4 - with: { python-version: "3.8" } - - - name: Install codespell - run: pip3 install codespell - - - name: Lint - run: cmake -D FORMAT_COMMAND=clang-format-14 -P cmake/lint.cmake - - - name: Spell check - if: always() - run: cmake -P cmake/spell.cmake - - test: - needs: [lint] - + tests: + defaults: + run: + shell: bash + concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }} + cancel-in-progress: true strategy: + fail-fast: false matrix: - os: [macos-12, ubuntu-22.04, windows-2022] - + os: [macos-latest, ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install dependencies - ubuntu + if: matrix.os == 'ubuntu-latest' + run: >- + sudo apt-get update + sudo apt-get install -y libhdf5-dev + + - name: Install dependencies - macos + if: matrix.os == 'macos-latest' + run: brew install hdf5 + + - name: Install dependencies - windows + if: matrix.os == 'windows-latest' + run: | + git clone https://github.com/Microsoft/vcpkg.git + cd vcpkg + ./bootstrap-vcpkg.bat + ./vcpkg integrate install + ./vcpkg install hdf5 - name: Install static analyzers - if: matrix.os == 'ubuntu-22.04' + if: matrix.os == 'ubuntu-latest' run: >- sudo apt-get install clang-tidy-14 cppcheck -y -q @@ -52,7 +58,7 @@ jobs: /usr/bin/clang-tidy-14 140 - name: Setup MultiToolTask - if: matrix.os == 'windows-2022' + if: matrix.os == 'windows-latest' run: | Add-Content "$env:GITHUB_ENV" 'UseMultiToolTask=true' Add-Content "$env:GITHUB_ENV" 'EnforceProcessCountAcrossBuilds=true'