Skip to content

Commit abe80c3

Browse files
yannrichetCopilot
andcommitted
ci: fix build/check to use current dir and exact tarball
- Replace 'pushd ..; R CMD build rlibkriging' with 'R CMD build .' to build from the checked-out directory directly, avoiding reliance on the parent directory name being 'rlibkriging' - Capture the built tarball path into PKG_FILE via GITHUB_ENV - Use $PKG_FILE in R CMD check instead of a glob that could match a stale/older tarball Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 1b84ab5 commit abe80c3

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

.github/workflows/submit-on-cran.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,13 @@ jobs:
4141

4242
- name: R CMD build
4343
shell: bash
44-
env: # this alias helps to reuse following line as script
44+
env:
4545
OS: ${{ matrix.os }}
4646
run: |
47-
pushd ..
48-
R CMD build rlibkriging
49-
mkdir rlibkriging/CRAN-$OS
50-
mv rlibkriging_*.* rlibkriging/CRAN-$OS/.
51-
popd
47+
R CMD build .
48+
mkdir CRAN-$OS
49+
mv rlibkriging_*.tar.gz CRAN-$OS/.
50+
echo "PKG_FILE=$(ls CRAN-$OS/rlibkriging_*.tar.gz)" >> $GITHUB_ENV
5251
5352
- name: Install dependencies for tests
5453
shell: bash
@@ -60,10 +59,8 @@ jobs:
6059
6160
- name: R CMD check
6261
shell: bash
63-
env:
64-
OS: ${{ matrix.os }}
6562
run: |
66-
R CMD check --as-cran --no-manual CRAN-$OS/rlibkriging* || (
63+
R CMD check --as-cran --no-manual "$PKG_FILE" || (
6764
test -f rlibkriging.Rcheck/00install.out && cat rlibkriging.Rcheck/00install.out | sed -e 's/^/00install.out| /' && echo "[The error may be shown before 00install.out| listing";
6865
exit 1
6966
)

0 commit comments

Comments
 (0)