Fix CRAN pre-test: https URLs, remove non-portable -Wno flags on Windows #36
This file contains hidden or 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: | |
| - master | |
| - dev | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| mecab_lang: ['ja', 'ko'] | |
| platform: [ubuntu-latest, windows-latest, macos-latest] | |
| r-version: ['release'] | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up R ${{ matrix.r-version }} | |
| uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: ${{ matrix.r-version }} | |
| - name: Install system dependencies (Ubuntu) | |
| if: ${{ matrix.platform == 'ubuntu-latest' }} | |
| run: | | |
| sudo apt-get update -y -qq | |
| sudo apt-get install -y libcurl4-openssl-dev | |
| - name: Install MeCab (Japanese, Ubuntu) | |
| if: ${{ matrix.platform == 'ubuntu-latest' && matrix.mecab_lang == 'ja' }} | |
| run: | | |
| sudo apt-get install -y mecab libmecab-dev mecab-ipadic-utf8 | |
| sudo ldconfig | |
| - name: Install MeCab-Ko (Korean, Ubuntu) | |
| if: ${{ matrix.platform == 'ubuntu-latest' && matrix.mecab_lang == 'ko' }} | |
| run: | | |
| curl -fsSL "https://github.com/Pusnow/mecab-ko-msvc/releases/download/release-0.999/mecab-ko-linux-x86_64.tar.gz" -o mecab-ko.tar.gz | |
| sudo tar xzf mecab-ko.tar.gz -C /usr/local --strip-components=1 | |
| sudo ldconfig | |
| curl -fsSL "https://github.com/Pusnow/mecab-ko-msvc/releases/download/release-0.999/mecab-ko-dic.tar.gz" -o mecab-ko-dic.tar.gz | |
| sudo mkdir -p /usr/local/lib/mecab/dic | |
| sudo tar xzf mecab-ko-dic.tar.gz -C /usr/local/lib/mecab/dic | |
| - name: Install MeCab (Japanese, macOS) | |
| if: ${{ matrix.platform == 'macos-latest' && matrix.mecab_lang == 'ja' }} | |
| run: brew install mecab mecab-ipadic | |
| - name: Install MeCab-Ko (Korean, macOS) | |
| if: ${{ matrix.platform == 'macos-latest' && matrix.mecab_lang == 'ko' }} | |
| run: | | |
| ARCH=$(uname -m) | |
| if [ "$ARCH" = "arm64" ]; then | |
| VARIANT="macos-arm64" | |
| else | |
| VARIANT="macos-x86_64" | |
| fi | |
| curl -fsSL "https://github.com/Pusnow/mecab-ko-msvc/releases/download/release-0.999/mecab-ko-${VARIANT}.tar.gz" -o mecab-ko.tar.gz | |
| sudo tar xzf mecab-ko.tar.gz -C /usr/local --strip-components=1 | |
| curl -fsSL "https://github.com/Pusnow/mecab-ko-msvc/releases/download/release-0.999/mecab-ko-dic.tar.gz" -o mecab-ko-dic.tar.gz | |
| sudo mkdir -p /usr/local/lib/mecab/dic | |
| sudo tar xzf mecab-ko-dic.tar.gz -C /usr/local/lib/mecab/dic | |
| - name: Install dependencies | |
| run: | | |
| install.packages(c("remotes", "rcmdcheck")) | |
| remotes::install_deps(dependencies = TRUE) | |
| shell: Rscript {0} | |
| - name: Check | |
| env: | |
| MECAB_LANG: ${{ matrix.mecab_lang }} | |
| run: | | |
| result <- rcmdcheck::rcmdcheck(args = c("--no-multiarch", "--no-manual", "--as-cran"), build_args = c("--no-manual", "--no-build-vignettes"), error_on = "never") | |
| log <- file.path(result$checkdir, "00install.out") | |
| if (file.exists(log)) cat("== 00install.out ==\n", readLines(log), sep="\n") | |
| if (length(result$errors) > 0) stop("R CMD check found ERRORs") | |
| shell: Rscript {0} |