assignUser commented on code in PR #13149:
URL: https://github.com/apache/arrow/pull/13149#discussion_r882803355


##########
dev/tasks/r/github.nightly.yml:
##########
@@ -0,0 +1,304 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+{% import 'macros.jinja' as macros with context %}
+
+# This allows us to set a custom version via param:
+# crossbow submit --param custom_version=8.5.3 r-nightly-packages
+# if the param is unset defaults to the usual Ymd naming scheme
+{% set version = custom_version|default("\\2.\'\"$(date +%Y%m%d)\"\'") %}
+# We need this as boolean and string
+{% set is_upstream_b = arrow.github_repo == 'apache/arrow' %}
+# use filter to cast to string and convert to lowercase to match yaml boolean
+{% set is_fork = (not is_upstream_b)|lower %}
+{% set is_upstream = is_upstream_b|lower %}
+
+
+{{ macros.github_header() }}
+
+jobs:
+  source:
+    # This job will change the version to either the custom_version param or 
YMD format.
+    # The output allows other steps to use the exact version to prevent issues 
(e.g. date changes during run)
+    name: Source Package
+    runs-on: ubuntu-latest
+    outputs:
+      version: {{ '${{ steps.save-version.outputs.version }}' }}
+    steps:
+      {{ macros.github_checkout_arrow()|indent }}
+      {{ macros.github_change_r_pkg_version(is_fork, version)|indent }}
+      - name: Save Version
+        id: save-version
+        shell: bash
+        run: | 
+          echo "::set-output name=version::$(grep ^Version arrow/r/DESCRIPTION 
| sed s/Version:\ //)"
+
+      - uses: r-lib/actions/setup-r@v2
+        with:
+          install-r: false
+
+      - name: Build R source package
+        shell: bash
+        run: |
+          cd arrow/r
+          # Copy in the Arrow C++ source
+          make sync-cpp
+          R CMD build --no-build-vignettes .
+
+      - name: Upload package artifact
+        uses: actions/upload-artifact@v3
+        with:
+          name: r-pkg_src
+          path: arrow/r/arrow_*.tar.gz
+
+  linux-cpp:
+    name: C++ Binary {{ '${{ matrix.config.os }}-${{ matrix.config.version }}' 
}}
+    runs-on: ubuntu-latest
+    needs: source
+    strategy:
+      fail-fast: false
+      matrix:
+        config:
+          - { os: ubuntu, version: "18.04" }
+          - { os: centos, version: "7" }
+    env:
+      UBUNTU: {{ '${{ matrix.config.version }}' }}
+    steps:
+      {{ macros.github_checkout_arrow()|indent }}
+      {{ macros.github_change_r_pkg_version(is_fork, '${{ 
needs.source.outputs.version }}')|indent }}
+      {{ macros.github_install_archery()|indent }}
+      - name: Build libarrow
+        shell: bash
+        run: |
+          sudo sysctl -w kernel.core_pattern="core.%e.%p"
+          ulimit -c unlimited
+          archery docker run  {{ '${{ matrix.config.os}}' }}-cpp-static
+      - name: Bundle libarrow
+        shell: bash
+        env:
+          PKG_FILE: arrow-{{ '${{ needs.source.outputs.version }}' }}.zip
+          VERSION: {{ '${{ needs.source.outputs.version }}' }}
+        run: |
+          cd arrow/r/libarrow/dist
+          # These files were created by the docker user so we have to sudo to 
get them
+          sudo -E zip -r $PKG_FILE lib/ include/
+          
+      - name: Upload binary artifact
+        uses: actions/upload-artifact@v3
+        with:
+          name: r-libarrow-{{ '${{ matrix.config.os}}' }}
+          path: arrow/r/libarrow/dist/arrow-*.zip
+
+  windows-cpp:
+    name: C++ Binary Windows RTools (40 only)
+    needs: source
+    runs-on: windows-latest
+    steps:
+      - run: git config --global core.autocrlf false
+      {{ macros.github_checkout_arrow()|indent }}
+      {{ macros.github_change_r_pkg_version(is_fork, '${{ 
needs.source.outputs.version }}')|indent }}
+
+      - uses: r-lib/actions/setup-r@v2
+        with:
+          rtools-version: 40
+          r-version: "4.0"
+          Ncpus: 2
+
+      - name: Build Arrow C++ with rtools40
+        shell: bash
+        env:
+          ARROW_HOME: "arrow"
+        run: arrow/ci/scripts/r_windows_build.sh
+
+      - name: Upload binary artifact
+        uses: actions/upload-artifact@v3
+        with:
+          name: r-libarrow-windows
+          path: build/arrow-*.zip 
+
+  r-packages:
+    if: true && !cancelled()
+    needs: [source, windows-cpp]
+    name: {{ '${{ matrix.platform }} ${{ matrix.r_version.r }}' }}
+    runs-on: {{ '${{ matrix.platform }}' }}
+    strategy:
+      fail-fast: false
+      matrix:
+        platform:
+          - windows-latest
+          # This is newer than what CRAN builds on, but Travis is no longer an 
option for us, so...
+          - macos-10.15
+          # - devops-managed # No M1 until the runner application runs native
+        r_version:
+          - { rtools: 40, r: "4.1" }
+          - { rtools: 42, r: "4.2" }
+    steps:
+      - uses: r-lib/actions/setup-r@v2
+        with:
+          r-version: {{ '${{ matrix.r_version.r }}' }}
+          rtools-version: {{ '${{ matrix.r_version.rtools }}' }}
+          Ncpus: 2
+      {{ macros.github_setup_local_r_repo('matrix.platform')|indent }}
+      - name: Build Binary
+        shell: Rscript {0}
+        run: |
+          on_windows <- tolower(Sys.info()[["sysname"]]) == "windows"
+
+          # Install dependencies by installing (yesterday's) binary, then 
removing it
+          install.packages(c("arrow", "cpp11"),
+            type = "binary",
+            repos = c("https://nightlies.apache.org/arrow/r";, 
"https://cloud.r-project.org";)
+          )
+          remove.packages("arrow")
+
+          # Setup local repo
+          dev_repo <- paste0(
+            ifelse(on_windows, "file:", "file://"),
+            getwd(),
+            "/repo")
+          
+          options(arrow.dev_repo = dev_repo)

Review Comment:
   Since https://github.com/apache/arrow/pull/13173 it should be used in 
`winlibs.R` to use libarrow from the local repo instead of arrow-r-nightly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to