Skip to content

Commit 8a80980

Browse files
authored
Avoid duplicated amrex.pdf (#173)
1 parent 525d631 commit 8a80980

6 files changed

Lines changed: 69 additions & 17 deletions

File tree

.github/dependabot.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
# To get started with Dependabot version updates, you'll need to specify which
2-
# package ecosystems to update and where the package manifests are located.
3-
# Please see the documentation for all configuration options:
4-
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5-
1+
# Dependabot configuration
2+
# ref: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates
63
version: 2
74
updates:
8-
- package-ecosystem: "" # See documentation for possible values
9-
directory: "/" # Location of package manifests
5+
- package-ecosystem: "github-actions"
6+
directory: "/"
107
schedule:
118
interval: "weekly"
129
target-branch: "main"

.github/workflows/docs.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Build and Deploy
2-
on: [push, pull_request]
2+
on:
3+
push:
4+
branches-ignore:
5+
- 'dependabot/**'
6+
pull_request:
37

48
concurrency:
59
group: ${{ github.ref }}-${{ github.head_ref }}-docs
@@ -13,6 +17,7 @@ jobs:
1317
uses: actions/checkout@v4
1418
with:
1519
persist-credentials: false
20+
fetch-depth: ${{ github.event_name != 'push' && 1 || 0 }}
1621

1722
- name: Dependencies
1823
run: |
@@ -29,6 +34,20 @@ jobs:
2934
mv build/latex/amrex.pdf source/
3035
make html
3136
37+
- name: Prepare deployment
38+
if: github.event_name == 'push'
39+
run: |
40+
LAST_DEPLOYED=$(curl -sSf "https://raw.githubusercontent.com/AMReX-Codes/AMReX-Codes.github.io/main/amrex/tutorials_html/.deploy-sha" 2>/dev/null || echo "")
41+
if [ -n "$LAST_DEPLOYED" ] && git cat-file -e "${LAST_DEPLOYED}^{commit}" 2>/dev/null; then
42+
if ! git diff --name-only ${LAST_DEPLOYED}..HEAD \
43+
| grep -q "^Docs/source/"; then
44+
echo "No sphinx doc changes since ${LAST_DEPLOYED} — removing PDF to keep published version"
45+
rm -f Docs/build/html/_downloads/*/amrex.pdf
46+
fi
47+
else
48+
echo "No previous deploy SHA reachable — keeping PDF"
49+
fi
50+
3251
- name: Deploy
3352
if: github.event_name == 'push' && github.repository == 'AMReX-Codes/amrex-tutorials' && github.ref == 'refs/heads/main'
3453
env:
@@ -57,6 +76,7 @@ jobs:
5776
git clone --quiet --depth=1 -b main git@github.com:AMReX-Codes/AMReX-Codes.github.io
5877
cd AMReX-Codes.github.io/amrex/tutorials_html/
5978
rsync -q -av --checksum --progress ${DEPLOY_SOURCE}/. .
79+
echo "${DEPLOY_SOURCE_HEAD}" > .deploy-sha
6080
git add --all .
6181
if [ -n "$(git status --porcelain)" ]; then
6282
git commit -m "Deploying from amrex-tutorials ${DEPLOY_SOURCE_HEAD}" --no-verify

.github/workflows/linux.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: linux
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'dependabot/**'
7+
pull_request:
8+
9+
concurrency:
10+
group: ${{ github.ref }}-${{ github.head_ref }}-linux
11+
cancel-in-progress: true
412

513
jobs:
614

.github/workflows/macos.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: macos
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'dependabot/**'
7+
pull_request:
8+
9+
concurrency:
10+
group: ${{ github.ref }}-${{ github.head_ref }}-macos
11+
cancel-in-progress: true
412

513
env:
614
CXXFLAGS: "-Werror -Wshadow -Woverloaded-virtual -Wextra-semi -Wunreachable-code -fno-operator-names -Wno-pass-failed"

.github/workflows/style.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: Style
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'dependabot/**'
7+
pull_request:
8+
9+
concurrency:
10+
group: ${{ github.ref }}-${{ github.head_ref }}-style
11+
cancel-in-progress: true
412

513
jobs:
614
tabs:

.github/workflows/windows.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: windows
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'dependabot/**'
7+
pull_request:
8+
9+
concurrency:
10+
group: ${{ github.ref }}-${{ github.head_ref }}-windows
11+
cancel-in-progress: true
412

513
jobs:
614
# Build all tutorials
@@ -28,16 +36,19 @@ jobs:
2836
name: Clang w/o Fortran w/o MPI
2937
runs-on: windows-latest
3038
steps:
31-
- uses: actions/checkout@v4
39+
- uses: actions/checkout@v6
40+
- uses: seanmiddleditch/gha-setup-ninja@master
41+
- name: Set Up MSVC
42+
uses: ilammy/msvc-dev-cmd@v1
3243
- name: Build & Install
3344
shell: cmd
34-
env:
35-
CMAKE_GENERATOR_TOOLSET: "ClangCl"
36-
CMAKE_GENERATOR: "Visual Studio 17 2022"
3745
run: |
38-
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\vc\Auxiliary\build\vcvarsall.bat" x64
3946
cd ExampleCodes
4047
cmake -S . -B build ^
48+
-G Ninja ^
49+
-DCMAKE_C_COMPILER=clang-cl ^
50+
-DCMAKE_CXX_COMPILER=clang-cl ^
51+
-DCMAKE_CXX_STANDARD=20 ^
4152
-DCMAKE_BUILD_TYPE=Release ^
4253
-DBUILD_SHARED_LIBS=ON ^
4354
-DCMAKE_VERBOSE_MAKEFILE=ON ^

0 commit comments

Comments
 (0)