Release Testing (Devel) #51
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Testing (Devel) | |
on: | |
push: | |
branches: | |
- 'release/**' | |
pull_request: | |
branches: | |
- 'release/**' | |
workflow_dispatch: | |
jobs: | |
version_check: | |
name: Confirm Whole Version Number | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repository | |
uses: actions/checkout@v4 | |
- name: Display Version Found | |
shell: bash | |
run: grep -E "Version:" $GITHUB_WORKSPACE/DESCRIPTION | |
- name: Test if it is a production pattern (#.#.#) | |
shell: bash | |
run: grep -E "Version:\s\d+\.\d+\.\d+$" $GITHUB_WORKSPACE/DESCRIPTION | |
devel_test: | |
name: ${{ matrix.os }} (R ${{ matrix.r-version }}) | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
r-version: 'devel' | |
- os: macos-latest | |
r-version: 'devel' | |
- os: windows-latest | |
r-version: 'devel' | |
steps: | |
- name: checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: If local, apt update | |
if: ${{ (env.ACT || false) && (matrix.os == 'ubuntu-latest')}} | |
run: sudo apt update | |
- name: Install Tidy Ubuntu | |
if: matrix.os == 'ubuntu-latest' | |
run: sudo apt install -y tidy | |
- name: set up R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: ${{ matrix.r-version }} | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- uses: r-lib/actions/setup-tinytex@v2 | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
extra-packages: any::rcmdcheck | |
needs: check | |
- uses: r-lib/actions/check-r-package@v2 | |
with: | |
args: 'c("--as-cran")' | |
error-on: '"warning"' | |
check-dir: '"check"' | |
upload-results: '"true"' | |
upload-snapshots: '"true"' | |
all-successful: | |
runs-on: ubuntu-latest | |
needs: [version_check, devel_test] | |
steps: | |
- name: Note that all tests succeeded | |
run: echo "🎉" | |
build-tarball: | |
runs-on: ubuntu-latest | |
needs: [version_check] | |
steps: | |
- name: checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Install Tidy Ubuntu | |
run: apt update && sudo apt install -y tidy | |
- name: build tarball for submission to CRAN | |
run: R CMD build $GITHUB_WORKSPACE | |
- name: Grab tarball path | |
shell: bash | |
run: | | |
TAR_NAME="pkgnet_" | |
TAR_NAME+="$(grep -E "Version:" $GITHUB_WORKSPACE/DESCRIPTION | cut -f2- -d: | awk '{$1=$1};1')" | |
TAR_NAME+=".tar.gz" | |
echo "TAR_NAME=$TAR_NAME" >> $GITHUB_ENV | |
- name: Upload tarball to run | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{env.TAR_NAME}} | |
path: ${{github.workspace}}/${{env.TAR_NAME}} | |
if-no-files-found: error | |
compression-level: 0 # already compressed | |