diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ede4b5bf..5c690e12 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,12 +1,9 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file - +# Dependabot configuration +# ref: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates version: 2 updates: - - package-ecosystem: "" # See documentation for possible values - directory: "/" # Location of package manifests + - package-ecosystem: "github-actions" + directory: "/" schedule: interval: "weekly" target-branch: "main" diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c927928f..42f1d732 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,5 +1,9 @@ name: Build and Deploy -on: [push, pull_request] +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: concurrency: group: ${{ github.ref }}-${{ github.head_ref }}-docs @@ -13,6 +17,7 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false + fetch-depth: ${{ github.event_name != 'push' && 1 || 0 }} - name: Dependencies run: | @@ -29,6 +34,20 @@ jobs: mv build/latex/amrex.pdf source/ make html + - name: Prepare deployment + if: github.event_name == 'push' + run: | + LAST_DEPLOYED=$(curl -sSf "https://raw.githubusercontent.com/AMReX-Codes/AMReX-Codes.github.io/main/amrex/tutorials_html/.deploy-sha" 2>/dev/null || echo "") + if [ -n "$LAST_DEPLOYED" ] && git cat-file -e "${LAST_DEPLOYED}^{commit}" 2>/dev/null; then + if ! git diff --name-only ${LAST_DEPLOYED}..HEAD \ + | grep -q "^Docs/source/"; then + echo "No sphinx doc changes since ${LAST_DEPLOYED} — removing PDF to keep published version" + rm -f Docs/build/html/_downloads/*/amrex.pdf + fi + else + echo "No previous deploy SHA reachable — keeping PDF" + fi + - name: Deploy if: github.event_name == 'push' && github.repository == 'AMReX-Codes/amrex-tutorials' && github.ref == 'refs/heads/main' env: @@ -57,6 +76,7 @@ jobs: git clone --quiet --depth=1 -b main git@github.com:AMReX-Codes/AMReX-Codes.github.io cd AMReX-Codes.github.io/amrex/tutorials_html/ rsync -q -av --checksum --progress ${DEPLOY_SOURCE}/. . + echo "${DEPLOY_SOURCE_HEAD}" > .deploy-sha git add --all . if [ -n "$(git status --porcelain)" ]; then git commit -m "Deploying from amrex-tutorials ${DEPLOY_SOURCE_HEAD}" --no-verify diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 21015604..cac02b31 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1,6 +1,14 @@ name: linux -on: [push, pull_request] +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: + +concurrency: + group: ${{ github.ref }}-${{ github.head_ref }}-linux + cancel-in-progress: true jobs: diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 534c64bd..4d3db5d0 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,6 +1,14 @@ name: macos -on: [push, pull_request] +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: + +concurrency: + group: ${{ github.ref }}-${{ github.head_ref }}-macos + cancel-in-progress: true env: CXXFLAGS: "-Werror -Wshadow -Woverloaded-virtual -Wextra-semi -Wunreachable-code -fno-operator-names -Wno-pass-failed" diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 1686ecca..9398a389 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -1,6 +1,14 @@ name: Style -on: [push, pull_request] +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: + +concurrency: + group: ${{ github.ref }}-${{ github.head_ref }}-style + cancel-in-progress: true jobs: tabs: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 3df1ca86..e6b5d56c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,6 +1,14 @@ name: windows -on: [push, pull_request] +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: + +concurrency: + group: ${{ github.ref }}-${{ github.head_ref }}-windows + cancel-in-progress: true jobs: # Build all tutorials @@ -28,16 +36,19 @@ jobs: name: Clang w/o Fortran w/o MPI runs-on: windows-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 + - uses: seanmiddleditch/gha-setup-ninja@master + - name: Set Up MSVC + uses: ilammy/msvc-dev-cmd@v1 - name: Build & Install shell: cmd - env: - CMAKE_GENERATOR_TOOLSET: "ClangCl" - CMAKE_GENERATOR: "Visual Studio 17 2022" run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\vc\Auxiliary\build\vcvarsall.bat" x64 cd ExampleCodes cmake -S . -B build ^ + -G Ninja ^ + -DCMAKE_C_COMPILER=clang-cl ^ + -DCMAKE_CXX_COMPILER=clang-cl ^ + -DCMAKE_CXX_STANDARD=20 ^ -DCMAKE_BUILD_TYPE=Release ^ -DBUILD_SHARED_LIBS=ON ^ -DCMAKE_VERBOSE_MAKEFILE=ON ^