Another attempt to work on macOS homebrew issue on GH actions #273
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: R-CMD-check | ||
on: | ||
push: | ||
branches: [main, master] | ||
pull_request: | ||
branches: [main, master] | ||
jobs: | ||
R-CMD-check: | ||
name: ${{ matrix.config.os }} (${{ matrix.config.r }}) | ||
runs-on: ${{ matrix.config.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- {os: macOS-latest, r: 'release'} | ||
- {os: windows-latest, r: 'release'} | ||
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} | ||
- {os: ubuntu-latest, r: 'release'} | ||
- {os: ubuntu-latest, r: 'oldrel-1'} | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
R_KEEP_PKG_SOURCE: yes | ||
steps: | ||
- name: GHA Notify Slack - Build Starting | ||
id: slack | ||
if: always() | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }} | ||
uses: justinr636/github-action-slack-notify-build@v1 | ||
with: | ||
channel_id: C01MS7ECQ8Z | ||
status: STARTING | ||
color: warning | ||
- name: Check and Install Git LFS | ||
run: git lfs install | ||
- uses: actions/checkout@v2 | ||
- name: Generate Git LFS File List | ||
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id | ||
- name: Restore LFS Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: .git/lfs | ||
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1 | ||
- name: Pull LFS Files | ||
run: git lfs pull | ||
- uses: r-lib/actions/setup-pandoc@v2 | ||
- uses: r-lib/actions/setup-tinytex@v2 | ||
- run: tlmgr --version | ||
- name: Print Homebrew Environment Variables | ||
if: runner.os == 'macOS' | ||
run: | | ||
echo "HOMEBREW_PREFIX: $(brew --prefix)" | ||
echo "HOMEBREW_CELLAR: $(brew --cellar)" | ||
- name: Set Homebrew Prefix | ||
if: runner.os == 'macOS' | ||
run: echo "HOMEBREW_PREFIX=/opt/homebrew" >> $GITHUB_ENV | ||
- name: Initialize Homebrew | ||
if: runner.os == 'macOS' | ||
run: | | ||
eval "$(/opt/homebrew/bin/brew shellenv)" | ||
brew update | ||
- name: Install Ghostscript on Windows | ||
if: runner.os == 'Windows' | ||
run: choco install ghostscript --no-progress | ||
- name: Install Ghostscript on Linux | ||
if: runner.os == 'Linux' | ||
run: sudo apt-get install -y ghostscript | ||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
r-version: ${{ matrix.config.r }} | ||
http-user-agent: ${{ matrix.config.http-user-agent }} | ||
use-public-rspm: true | ||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: rcmdcheck | ||
- uses: r-lib/actions/check-r-package@v2 | ||
- name: GHA Slack Notify Build | ||
if: success() | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }} | ||
uses: justinr636/github-action-slack-notify-build@v1 | ||
with: | ||
message_id: ${{ steps.slack.outputs.message_id }} | ||
channel_id: C01MS7ECQ8Z | ||
status: SUCCESS | ||
color: good | ||
- name: GHA Slack Notify Build | ||
if: failure() | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }} | ||
uses: justinr636/github-action-slack-notify-build@v1 | ||
with: | ||
message_id: ${{ steps.slack.outputs.message_id }} | ||
channel_id: C01MS7ECQ8Z | ||
status: FAILED | ||
color: danger |