ci: fix build/check to use current dir and exact tarball #672
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: devtools-install_github | |
| on: | |
| push: | |
| pull_request: | |
| schedule: | |
| - cron: '0 2 * * SAT' | |
| # To automatically cancel previous jobs in same branch or PR | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| check-gitmodules-shas: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: false | |
| - name: Verify tools/gitmodules-shas is up to date | |
| shell: bash | |
| run: | | |
| expected="src/libK $(git ls-tree HEAD src/libK | awk '{print $3}')" | |
| actual=$(grep "^src/libK " tools/gitmodules-shas | head -1) | |
| if [ "$expected" != "$actual" ]; then | |
| echo "ERROR: tools/gitmodules-shas is out of date!" | |
| echo " Expected: $expected" | |
| echo " Actual: $actual" | |
| echo "Run: bash tools/update_submodule_shas.sh && git add tools/gitmodules-shas && git commit" | |
| exit 1 | |
| fi | |
| echo "✓ tools/gitmodules-shas is up to date: $actual" | |
| install_github: | |
| needs: check-gitmodules-shas | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ ubuntu-latest, windows-latest, macOS-latest ] | |
| R: [ 'release' ] | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: ${{ matrix.R }} | |
| rtools-version: '' | |
| - name: Install tools for Linux | |
| run: sudo apt install -y cmake gfortran libcurl4-openssl-dev libfontconfig1-dev | |
| shell: bash | |
| if: matrix.os == 'ubuntu-latest' | |
| - name: Install tools for macOS | |
| run: brew install cmake gfortran | |
| shell: bash | |
| if: matrix.os == 'macOS-latest' | |
| # Should be temporary since it was ok without additional system packages one month ago | |
| - name: Install additional packages to compile devtools | |
| shell: bash | |
| run: sudo apt install -y libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev libuv1-dev | |
| if: matrix.os == 'ubuntu-latest' | |
| - name: Setup cmake | |
| uses: jwlawson/actions-setup-cmake@v1.13 | |
| with: | |
| cmake-version: '3.24.x' | |
| - name: Install devtools | |
| shell: bash | |
| run: | | |
| # Download install_packages.R - use tag if available, otherwise master | |
| if [ -n "${{ github.ref_type == 'tag' && github.ref_name || '' }}" ]; then | |
| REF="${{ github.ref_name }}" | |
| else | |
| REF="master" | |
| fi | |
| # Add --insecure to workaround missing certificates on Windows | |
| curl --insecure --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' -LO "https://raw.githubusercontent.com/libKriging/rlibkriging/${REF}/tools/install_packages.R" | |
| Rscript --no-save ./install_packages.R remotes devtools | |
| - name: install_github (with tag) | |
| if: github.ref_type == 'tag' | |
| shell: bash | |
| run: Rscript -e "library(devtools); install_github('libKriging/rlibkriging@${{ github.ref_name }}'); if (!library('rlibkriging', character.only=TRUE, logical.return=TRUE)) quit(status=1, save='no')" | |
| - name: install_github (without tag) | |
| if: github.ref_type != 'tag' | |
| shell: bash | |
| run: Rscript -e "library(devtools); install_github('libKriging/rlibkriging'); if (!library('rlibkriging', character.only=TRUE, logical.return=TRUE)) quit(status=1, save='no')" |