ci: fixed the commit #72
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
| # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | |
| # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| name: R-CMD-check.yaml | |
| permissions: | |
| contents: write | |
| jobs: | |
| R-CMD-check: | |
| defaults: | |
| run: | |
| shell: pwsh | |
| runs-on: ${{ matrix.config.os }} | |
| name: ${{ matrix.config.os }} (${{ matrix.config.r }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: | |
| - { os: macos-latest, r: "oldrel-1" } | |
| - { os: macos-latest, r: "oldrel" } | |
| - { os: macos-latest, r: "release" } | |
| - { os: macos-latest, r: "next", http-user-agent: "release" } | |
| - { os: macos-latest, r: "devel", http-user-agent: "release" } | |
| - { os: windows-latest, r: "oldrel-1" } | |
| - { os: windows-latest, r: "oldrel" } | |
| - { os: windows-latest, r: "release" } | |
| - { os: windows-latest, r: "next", http-user-agent: "release" } | |
| - { os: windows-latest, r: "devel", http-user-agent: "release" } | |
| - { os: ubuntu-latest, r: "oldrel-1" } | |
| - { os: ubuntu-latest, r: "oldrel" } | |
| - { os: ubuntu-latest, r: "release" } | |
| - { os: ubuntu-latest, r: "next", http-user-agent: "release" } | |
| - { os: ubuntu-latest, r: "devel", http-user-agent: "release" } | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| R_KEEP_PKG_SOURCE: yes | |
| steps: | |
| - name: Install `bindgen` | |
| run: | | |
| # cargo install bindgen-cli | |
| cargo install bindgen-cli --git https://github.com/rust-lang/rust-bindgen.git | |
| - name: Add Rtools' targets to Rust | |
| if: runner.os == 'Windows' | |
| run: | | |
| rustup target add i686-pc-windows-gnu | |
| rustup target add x86_64-pc-windows-gnu | |
| rustup override set stable-gnu | |
| rustup component add rustfmt | |
| - uses: actions/checkout@v4 | |
| - 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: | |
| install-pandoc: false | |
| install-quarto: false | |
| extra-packages: any::rcmdcheck | |
| needs: check | |
| - uses: r-lib/actions/check-r-package@v2 | |
| with: | |
| error-on: '"error"' | |
| upload-snapshots: true | |
| build_args: 'c("--no-manual")' | |
| - name: Install the package to collect cached bindings | |
| run: | | |
| Del alias:R | |
| R CMD INSTALL . | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| retention-days: 1 | |
| name: cached_bindings-${{ matrix.config.os }}-R-${{ matrix.config.r }} | |
| path: cached_bindings/ | |
| overwrite: true | |
| commit: | |
| defaults: | |
| run: | |
| shell: pwsh | |
| needs: R-CMD-check | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: cached_bindings | |
| merge-multiple: true | |
| - name: Manually sort Windows bindings | |
| run: | | |
| Get-ChildItem -Path "cached_bindings" -Recurse -File -Filter "*-windows-*" | ForEach-Object { | |
| rustfmt --edition=2021 -v $_.FullName | |
| } | |
| - name: Push cached bindings to the repository | |
| run: | | |
| # Note: the following account information will not work on GHES | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add cached_bindings | |
| git commit -m "generated bindings" | |
| git push |