Skip to content

Commit 5c8b925

Browse files
committed
Revert "Normalize line endings to UNIX format"
This reverts commit f705d7f.
1 parent cc318bc commit 5c8b925

File tree

15 files changed

+860
-16
lines changed

15 files changed

+860
-16
lines changed

.github/workflows/cleanliness.yml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
name: Cleanliness
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
file-changes:
7+
name: Detect File Changes
8+
runs-on: 'ubuntu-latest'
9+
outputs:
10+
checkall: ${{ steps.changes.outputs.checkall }}
11+
steps:
12+
- name: Clone
13+
uses: actions/checkout@v4
14+
15+
- name: Detect Changes
16+
uses: dorny/paths-filter@v3
17+
id: changes
18+
with:
19+
filters: ".github/file-filter.yml"
20+
21+
cleanliness:
22+
name: Code Cleanliness Check
23+
if: needs.file-changes.outputs.checkall == 'true'
24+
needs: file-changes
25+
runs-on: "ubuntu-latest"
26+
env:
27+
pr_everything: 0
28+
master_everything: 0
29+
steps:
30+
- name: Clone - PR
31+
uses: actions/checkout@v4
32+
with:
33+
path: pr
34+
- name: Clone - Master
35+
uses: actions/checkout@v4
36+
with:
37+
repository: MFlowCode/MFC
38+
ref: master
39+
path: master
40+
41+
- name: Setup Ubuntu
42+
run: |
43+
sudo apt update -y
44+
sudo apt install -y tar wget make cmake gcc g++ python3 python3-dev "openmpi-*" libopenmpi-dev
45+
46+
- name: Build
47+
run: |
48+
(cd pr && /bin/bash mfc.sh build -j $(nproc) --debug 2> ../pr.txt)
49+
(cd master && /bin/bash mfc.sh build -j $(nproc) --debug 2> ../master.txt)
50+
sed -i '/\/pr\//d' pr.txt
51+
sed -i '/\/master\//d' master.txt
52+
53+
- name: Unused Variables Diff
54+
continue-on-error: true
55+
run: |
56+
grep -F 'Wunused-variable' master.txt > mUnused.txt
57+
grep -F 'Wunused-variable' pr.txt > prUnused.txt
58+
diff prUnused.txt mUnused.txt
59+
60+
- name: Unused Dummy Arguments Diff
61+
continue-on-error: true
62+
run: |
63+
grep -F 'Wunused-dummy-argument' pr.txt > prDummy.txt
64+
grep -F 'Wunused-dummy-argument' master.txt > mDummy.txt
65+
diff prDummy.txt mDummy.txt
66+
67+
- name: Unused Value Diff
68+
continue-on-error: true
69+
run: |
70+
grep -F 'Wunused-value' pr.txt > prUnused_val.txt
71+
grep -F 'Wunused-value' master.txt > mUnused_val.txt
72+
diff prUnused_val.txt mUnused_val.txt
73+
74+
- name: Maybe Uninitialized Variables Diff
75+
continue-on-error: true
76+
run: |
77+
grep -F 'Wmaybe-uninitialized' pr.txt > prMaybe.txt
78+
grep -F 'Wmaybe-uninitialized' master.txt > mMaybe.txt
79+
diff prMaybe.txt mMaybe.txt
80+
81+
82+
- name: Everything Diff
83+
continue-on-error: true
84+
run: |
85+
grep '\-W' pr.txt > pr_every.txt
86+
grep '\-W' master.txt > m_every.txt
87+
diff pr_every.txt m_every.txt
88+
89+
- name: List of Warnings
90+
run: |
91+
cat pr_every.txt
92+
93+
94+
- name: Summary
95+
continue-on-error: true
96+
run: |
97+
pr_variable=$(grep -c -F 'Wunused-variable' pr.txt)
98+
pr_argument=$(grep -c -F 'Wunused-dummy-argument' pr.txt)
99+
pr_value=$(grep -c -F 'Wunused-value' pr.txt)
100+
pr_uninit=$(grep -c -F 'Wmaybe-uninitialized' pr.txt)
101+
pr_everything=$(grep -c '\-W' pr.txt)
102+
103+
master_variable=$(grep -c -F 'Wunused-variable' master.txt)
104+
master_argument=$(grep -c -F 'Wunused-dummy-argument' master.txt)
105+
master_value=$(grep -c -F 'Wunused-value' master.txt)
106+
master_uninit=$(grep -c -F 'Wmaybe-uninitialized' master.txt)
107+
master_everything=$(grep -c '\-W' master.txt )
108+
109+
echo "pr_everything=$pr_everything" >> $GITHUB_ENV
110+
echo "master_everything=$master_everything" >> $GITHUB_ENV
111+
112+
echo "Difference is how many warnings were added or removed from master to PR."
113+
echo "Negative numbers are better since you are removing warnings."
114+
echo " "
115+
echo "Unused Variable Count: $pr_variable, Difference: $((pr_variable - master_variable))"
116+
echo "Unused Dummy Argument: $pr_argument, Difference: $((pr_argument - master_argument))"
117+
echo "Unused Value: $pr_value, Difference: $((pr_value - master_value))"
118+
echo "Maybe Uninitialized: $pr_uninit, Difference: $((pr_uninit - master_uninit))"
119+
echo "Everything: $pr_everything, Difference: $((pr_everything - master_everything))"
120+
121+
122+
- name: Check Differences
123+
if: env.pr_everything > env.master_everything
124+
run: |
125+
echo "Difference between warning count in PR is greater than in master."
126+
127+

.github/workflows/coverage.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Coverage Check
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
file-changes:
7+
name: Detect File Changes
8+
runs-on: 'ubuntu-latest'
9+
outputs:
10+
checkall: ${{ steps.changes.outputs.checkall }}
11+
steps:
12+
- name: Clone
13+
uses: actions/checkout@v4
14+
15+
- name: Detect Changes
16+
uses: dorny/paths-filter@v3
17+
id: changes
18+
with:
19+
filters: ".github/file-filter.yml"
20+
21+
run:
22+
name: Coverage Test on CodeCov
23+
if: needs.file-changes.outputs.checkall == 'true'
24+
needs: file-changes
25+
runs-on: "ubuntu-latest"
26+
steps:
27+
- name: Checkouts
28+
uses: actions/checkout@v4
29+
30+
- name: Setup Ubuntu
31+
run: |
32+
sudo apt update -y
33+
sudo apt install -y tar wget make cmake gcc g++ python3 python3-dev "openmpi-*" libopenmpi-dev
34+
35+
- name: Build
36+
run: /bin/bash mfc.sh build -j $(nproc) --gcov
37+
38+
- name: Test
39+
run: /bin/bash mfc.sh test -a -j $(nproc)
40+
41+
- name: Upload coverage reports to Codecov
42+
uses: codecov/codecov-action@v4
43+
with:
44+
fail_ci_if_error: false
45+
verbose: true
46+
env:
47+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
48+

.github/workflows/docs.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Documentation
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *' # This runs every day at midnight UTC
6+
workflow_dispatch:
7+
push:
8+
pull_request:
9+
10+
jobs:
11+
docs:
12+
name: Build & Publish
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
# We build doxygen from source because of
19+
# https://github.com/doxygen/doxygen/issues/9016
20+
- name: Build Doxygen
21+
run: |
22+
sudo apt update -y
23+
sudo apt install -y cmake ninja-build graphviz graphviz
24+
git clone https://github.com/doxygen/doxygen.git ../doxygen
25+
cd ../doxygen
26+
git checkout 26b5403
27+
cd -
28+
cmake -S ../doxygen -B ../doxygen/build -G Ninja
29+
sudo ninja -C ../doxygen/build install
30+
31+
- name: Build Documentation
32+
run: |
33+
pip3 install fypp
34+
cmake -S . -B build -G Ninja --install-prefix=$(pwd)/build/install -D MFC_DOCUMENTATION=ON
35+
ninja -C build install
36+
37+
# From here https://github.com/cicirello/generate-sitemap
38+
- name: Generate the sitemap
39+
id: sitemap
40+
uses: cicirello/generate-sitemap@v1
41+
with:
42+
base-url-path: https://mflowcode.github.io/
43+
path-to-root: build/install/docs/mfc
44+
include-pdf: false
45+
sitemap-format: txt
46+
47+
- name: Output stats
48+
run: |
49+
echo "sitemap-path = ${{ steps.sitemap.outputs.sitemap-path }}"
50+
echo "url-count = ${{ steps.sitemap.outputs.url-count }}"
51+
echo "excluded-count = ${{ steps.sitemap.outputs.excluded-count }}"
52+
53+
- name: Linkcheck - Lychee
54+
uses: lycheeverse/lychee-action@v2
55+
with:
56+
args: -c .lychee.toml build/install/docs/mfc/
57+
fail: false
58+
59+
- name: Publish Documentation
60+
if: github.repository == 'MFlowCode/MFC' && github.ref == 'refs/heads/master' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' )
61+
run: |
62+
set +e
63+
git ls-remote "${{ secrets.DOC_PUSH_URL }}" -q
64+
if [ "$?" -ne "0" ]; then exit 0; fi
65+
set -e
66+
git config --global user.name 'MFC Action'
67+
git config --global user.email '<>'
68+
git clone "${{ secrets.DOC_PUSH_URL }}" ../www
69+
rm -rf ../www/*
70+
mv build/install/docs/mfc/* ../www/
71+
git -C ../www add -A
72+
git -C ../www commit -m "Docs @ ${GITHUB_SHA::7}" || true
73+
git -C ../www push
74+
75+
# DOC_PUSH_URL should be of the format:
76+
# --> https://<username>:<token>@github.com/<username>/<repository>

.github/workflows/formatting.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Pretty
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
docs:
7+
name: Formatting
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: MFC Python setup
14+
run: ./mfc.sh init
15+
16+
- name: Check formatting
17+
run: |
18+
./mfc.sh format -j $(nproc)
19+
git diff --exit-code
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
#!/bin/bash
2-
3-
n_ranks=12
4-
5-
if [ "$job_device" == "gpu" ]; then
6-
gpus=$(rocm-smi --showid | awk '{print $1}' | grep -Eo '[0-9]+' | uniq | tr '\n' ' ')
7-
n_ranks=$(echo "$gpus" | wc -w) # number of GPUs on node
8-
gpu_ids=$(echo "$gpus" | tr ' ' '\n' | tr '\n' ' ' | sed 's/ $//') # GPU IDs from rocm-smi
9-
device_opts="--gpu -g $gpu_ids"
10-
fi
11-
12-
if [ "$job_device" == "gpu" ]; then
13-
./mfc.sh bench --mem 12 -j $n_ranks -o "$job_slug.yaml" -- -c frontier $device_opts -n $n_ranks
14-
else
15-
./mfc.sh bench --mem 1 -j $(nproc) -o "$job_slug.yaml" -- -c frontier $device_opts -n $n_ranks
16-
fi
1+
#!/bin/bash
2+
3+
n_ranks=12
4+
5+
if [ "$job_device" == "gpu" ]; then
6+
gpus=$(rocm-smi --showid | awk '{print $1}' | grep -Eo '[0-9]+' | uniq | tr '\n' ' ')
7+
n_ranks=$(echo "$gpus" | wc -w) # number of GPUs on node
8+
gpu_ids=$(echo "$gpus" | tr ' ' '\n' | tr '\n' ' ' | sed 's/ $//') # GPU IDs from rocm-smi
9+
device_opts="--gpu -g $gpu_ids"
10+
fi
11+
12+
if [ "$job_device" == "gpu" ]; then
13+
./mfc.sh bench --mem 12 -j $n_ranks -o "$job_slug.yaml" -- -c frontier $device_opts -n $n_ranks
14+
else
15+
./mfc.sh bench --mem 1 -j $(nproc) -o "$job_slug.yaml" -- -c frontier $device_opts -n $n_ranks
16+
fi

.github/workflows/line-count.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Lines of Code
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
file-changes:
7+
name: Detect File Changes
8+
runs-on: 'ubuntu-latest'
9+
outputs:
10+
checkall: ${{ steps.changes.outputs.checkall }}
11+
steps:
12+
- name: Clone
13+
uses: actions/checkout@v4
14+
15+
- name: Detect Changes
16+
uses: dorny/paths-filter@v3
17+
id: changes
18+
with:
19+
filters: ".github/file-filter.yml"
20+
21+
sz:
22+
name: Core MFC Line Difference
23+
if: needs.file-changes.outputs.checkall == 'true'
24+
needs: file-changes
25+
permissions:
26+
contents: read
27+
pull-requests: write
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout code from PR branch
31+
uses: actions/checkout@v4
32+
with:
33+
path: pr
34+
35+
- name: Checkout code from MFC master
36+
uses: actions/checkout@v4
37+
with:
38+
repository: ${{ github.event.pull_request.repository }}
39+
ref: ${{ github.event.pull_request.base.ref }}
40+
path: base
41+
# repository: MFlowCode/MFC
42+
# ref: master
43+
# path: base
44+
45+
- name: Get Line Diff
46+
run: |
47+
BASE="$GITHUB_WORKSPACE/base"
48+
PR="$GITHUB_WORKSPACE/pr"
49+
cd $BASE
50+
export MFC_PR=$PR
51+
pwd
52+
./mfc.sh init &> tmp.txt
53+
./mfc.sh count_diff
54+

0 commit comments

Comments
 (0)