Skip to content

Nighly build

Nighly build #757

Workflow file for this run

name: Nighly build
on:
workflow_dispatch:
inputs:
macos:
description: 'Build x86_64 macOS packages'
required: true
type: choice
options:
- 'yes'
- 'no'
default: 'yes'
windows:
description: 'Build Windows packages'
required: true
type: choice
options:
- 'yes'
- 'no'
default: 'yes'
linux:
description: 'Build x86_64 Linux packages'
required: true
type: choice
options:
- 'yes'
- 'no'
default: 'yes'
macos-m1:
description: 'Build arm64 macOS packages'
required: true
type: choice
options:
- 'yes'
- 'no'
default: 'yes'
linux-arm64:
description: 'Build arm64 Linux packages'
required: true
type: choice
options:
- 'yes'
- 'no'
default: 'yes'
deploy:
description: 'Deploy packages'
required: true
type: choice
options:
- 'yes'
- 'no'
default: 'yes'
schedule:
- cron: '30 5 * * *'
# =========================================================================
jobs:
debug:
runs-on: ubuntu-latest
if: always()
name: Parameters
steps:
- name: Input parameters
run: |
echo "macos: ${{ github.event.inputs.macos }}"
echo "windows: ${{ github.event.inputs.windows }}"
echo "linux: ${{ github.event.inputs.linux }}"
echo "macos-m1: ${{ github.event.inputs.macos-m1 }}"
echo "linux-arm64: ${{ github.event.inputs.linux-arm64 }}"
echo "deploy: ${{ github.event.inputs.deploy }}"
echo "macos: ${{ github.event.inputs.macos == 'yes' }}"
echo "windows: ${{ github.event.inputs.windows == 'yes' }}"
echo "linux: ${{ github.event.inputs.linux == 'yes' }}"
echo "macos-m1: ${{ github.event.inputs.macos-m1 == 'yes' }}"
echo "linux-arm64: ${{ github.event.inputs.linux-arm64 == 'yes' }}"
echo "deploy: ${{ github.event.inputs.deploy == 'yes' }}"
# -----------------------------------------------------------------------
macos:
runs-on: macos-11
if: ${{ github.event.inputs.macos == '' || github.event.inputs.macos == 'yes' }}
name: macOS x86_64 pak binaries
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: Install rig
run: |
brew tap r-lib/rig
brew install r-lib/rig/rig
- name: Install R
run: |
sudo rig add 3.5
sudo rig add 3.6
sudo rig add 4.0
sudo rig add 4.1
sudo rig add 4.2
sudo rig add release
sudo rig add devel
rig default release
- name: Install skopeo
run: |
brew install skopeo
brew link skopeo
skopeo --version
- name: Build pak binaries
run: |
cd tools/build/macos && make build
- name: Run tests
run: |
cd tools/build/macos && make test
- name: Deploy packages
run: |
cd tools/build/macos && make deploy
env:
PAK_GHCR_TOKEN: ${{ secrets.PAK_GHCR_TOKEN }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# -----------------------------------------------------------------------
windows:
runs-on: windows-latest
if: ${{ github.event.inputs.windows == '' || github.event.inputs.windows == 'yes' }}
name: Windows pak binaries
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: git config
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
- name: Install rig
run: |
choco install rig
# For make
echo "C:\rtools40\usr\bin" | Out-File -Append -FilePath $env:GITHUB_PATH
- name: Install skopeo
run: |
Invoke-WebRequest -Uri https://github.com/gaborcsardi/skopeo/releases/download/v1.6.0/skopeo-1.6.0.zip -OutFile skopeo.zip
New-Item "C:\Tools" -Force -ItemType Directory
Expand-Archive skopeo.zip -DestinationPath C:\Tools
echo "C:\Tools\skopeo" | Out-File -Append -FilePath $env:GITHUB_PATH
- name: Test skopeo
run: |
skopeo --version
# We use the pre-installed R 4.1.3 + Rtools40 for now, to speed this up
- name: Install R and RTools
run: |
rig add 3.5
rig add 3.6
rig add 4.0
rig add 4.1
rig add 4.2
rig add 4.3
rig add devel
rig add rtools35
rig add rtools40
rig default 4.2.3
- name: Build pak binaries
run: |
cd tools/build/windows && make build
- name: Run tests
run: |
cd tools/build/windows && make test
- name: Deploy packages
run: |
cd tools/build/windows && make deploy
env:
PAK_GHCR_TOKEN: ${{ secrets.PAK_GHCR_TOKEN }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# -----------------------------------------------------------------------
linux:
runs-on: ubuntu-latest
if: ${{ github.event.inputs.linux == '' || github.event.inputs.linux == 'yes' }}
name: Linux static pak binaries for R ${{ matrix.config.r }}, ${{ matrix.config.platform }}
strategy:
fail-fast: false
matrix:
config:
- { r: '4.4', platform: 'linux/amd64' }
- { r: '4.3', platform: 'linux/amd64' }
- { r: '4.2', platform: 'linux/amd64' }
- { r: '4.1', platform: 'linux/amd64' }
- { r: '4.0', platform: 'linux/amd64' }
- { r: '3.6', platform: 'linux/amd64' }
- { r: '3.5', platform: 'linux/amd64' }
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: Build and push
run: |
docker build \
--pull \
--build-arg ARCH=x86_64 \
--build-arg R_MAJOR=${{ matrix.config.r }} \
--build-arg TOKEN=${{ secrets.PAK_GHCR_TOKEN }} \
--build-arg PAK_ROOT=. \
-f tools/build/linux/Dockerfile .
# ------------------------------------------------------------------------
macos-m1:
runs-on: [macos-arm64]
if: ${{ github.event.inputs.macos-m1 == '' || github.event.inputs.macos-m1 == 'yes' }}
name: macos arm64 pak binaries
env:
RVERSIONS: "4.1-arm64 4.2-arm64 4.3-arm64 4.4-arm64"
RVERSION_DEFAULT: 4.3-arm64
defaults:
run:
shell: "/usr/bin/arch -arch arm64 /bin/bash {0}"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: git config
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
- name: Build pak binaries
run: |
cd tools/build/macos && make build
- name: Run tests
run: |
cd tools/build/macos && make test
- name: Deploy packages
run: |
cd tools/build/macos && make deploy
env:
PAK_GHCR_TOKEN: ${{ secrets.PAK_GHCR_TOKEN }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# ------------------------------------------------------------------------
linux-arm64:
runs-on: [linux-arm64]
if: ${{ github.event.inputs.linux-arm64 == '' || github.event.inputs.linux-arm64 == 'yes' }}
name: Linux static pak binaries for R ${{ matrix.config.r }}, ${{ matrix.config.platform }}
strategy:
fail-fast: false
matrix:
config:
- { r: '4.4', platform: 'linux/arm64' }
- { r: '4.3', platform: 'linux/arm64' }
- { r: '4.2', platform: 'linux/arm64' }
- { r: '4.1', platform: 'linux/arm64' }
- { r: '4.0', platform: 'linux/arm64' }
- { r: '3.6', platform: 'linux/arm64' }
- { r: '3.5', platform: 'linux/arm64' }
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: Build and push
run: |
docker system prune -f
docker build \
--pull \
--build-arg ARCH=aarch64 \
--build-arg R_MAJOR=${{ matrix.config.r }} \
--build-arg TOKEN=${{ secrets.PAK_GHCR_TOKEN }} \
--build-arg PAK_ROOT=. \
-f tools/build/linux/Dockerfile .
# ------------------------------------------------------------------------
deploy:
runs-on: ubuntu-latest
if: ${{ (github.event.inputs.deploy == '' || github.event.inputs.deploy == 'yes') && always() }}
needs: [ macos, windows, linux, macos-m1, linux-arm64 ]
steps:
- name: Update Ubuntu package db
run: |
sudo apt-get update
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: Create user library
run: |
dir.create(Sys.getenv("R_LIBS_USER"), recursive = TRUE)
shell: Rscript {0}
- name: Dependencies
uses: r-lib/actions/setup-r-dependencies@v2-branch
- name: Install local pak tree
run: R CMD INSTALL .
env:
PAK_BUNDLE: false
- name: Create repository
run: |
pak:::create_pak_repo("repo")
shell: Rscript {0}
- name: Deploy to GitHub pages (test)
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
repository-name: r-lib/r-lib.github.io
token: ${{ secrets.PAK_GHCR_TOKEN }}
single-commit: true
clean: true
branch: test
folder: repo
- name: Run tests
run: |
testthat::test_local(filter = "^repo$")
shell: Rscript {0}
env:
PAK_TESTS: true
- name: Deploy to GitHub Pages (prod)
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
repository-name: r-lib/r-lib.github.io
token: ${{ secrets.PAK_GHCR_TOKEN }}
single-commit: true
clean: true
branch: gh-pages
folder: repo