Skip to content

Commit 7bf9854

Browse files
committed
improve diff handling for compressed data
1 parent 5f9791a commit 7bf9854

1 file changed

Lines changed: 19 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,14 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v6
2121
with:
22-
# lfs: true
22+
lfs: true
2323
ref: ${{ github.ref || github.ref_name }}
2424

25-
- name: Configure Git and pull from LFS
25+
# https://github.com/actions/checkout?tab=readme-ov-file#push-a-commit-using-the-built-in-token
26+
- name: Configure Git for pushing from actions
2627
run: |
2728
git config user.name "github-actions[bot]"
2829
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
29-
git config lfs.fetchexclude "reference"
30-
git lfs pull
3130
3231
- name: Install roman_imsim
3332
run: |
@@ -36,16 +35,24 @@ jobs:
3635
3736
- name: Run GalSim
3837
run: |
39-
galsim hack.yaml output.dir=reference/RomanWAS_new/images/truth output.truth.dir=reference/RomanWAS_new/truth
38+
galsim hack.yaml
4039
41-
# https://github.com/actions/checkout?tab=readme-ov-file#push-a-commit-using-the-built-in-token
4240
- name: Commit and push output
4341
run: |
44-
if git diff --exit-code; then
45-
echo "reference/ is unchanged; no action needed"
42+
if zdiff output/RomanWAS_new/images/truth/Roman_WAS_truth_J129_12909_4.fits.gz reference/RomanWAS_new/images/truth/Roman_WAS_truth_J129_12909_4.fits.gz; then
43+
echo "reference image is unchanged"
44+
else
45+
echo "reference image is changed"
46+
mv -v output/RomanWAS_new/images/truth/Roman_WAS_truth_J129_12909_4.fits.gz reference/RomanWAS_new/images/truth/Roman_WAS_truth_J129_12909_4.fits.gz
47+
fi
48+
49+
if diff output/RomanWAS_new/truth/Roman_WAS_index_J129_12909_4.txt reference/RomanWAS_new/truth/Roman_WAS_index_J129_12909_4.txt); then
50+
echo "reference table is unchanged"
4651
else
47-
echo "reference/ is changed; pushing updates"
48-
git add reference
49-
git commit -m "Update reference image"
50-
git push
52+
echo "reference table is changed"
53+
mv -v output/RomanWAS_new/truth/Roman_WAS_index_J129_12909_4.txt reference/RomanWAS_new/truth/Roman_WAS_index_J129_12909_4.txt
5154
fi
55+
56+
git add reference
57+
git commit -m "Update reference"
58+
git push

0 commit comments

Comments
 (0)