build.yaml #56
This file contains 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: build.yaml | |
on: | |
workflow_dispatch: | |
inputs: | |
rversion: | |
description: 'R version' | |
required: true | |
type: string | |
build: | |
description: 'Build and run tests (x86_64)' | |
required: true | |
type: choice | |
options: | |
- 'yes' | |
- 'no' | |
default: 'yes' | |
deploy: | |
description: 'Deploy packages after testing (x86_64)' | |
required: true | |
type: choice | |
options: | |
- 'yes' | |
- 'no' | |
default: 'no' | |
buildarm: | |
description: 'Build and run tests (aarch64)' | |
required: true | |
type: choice | |
options: | |
- 'yes' | |
- 'no' | |
default: 'yes' | |
deployarm: | |
description: 'Deploy packages after testing (aarch64)' | |
required: true | |
type: choice | |
options: | |
- 'yes' | |
- 'no' | |
default: 'no' | |
jobs: | |
build: | |
if: ${{ github.event.inputs.build == '' || github.event.inputs.build == 'yes' }} | |
name: build | |
runs-on: ubuntu-latest | |
env: | |
R_VERSION: '${{ github.event.inputs.rversion }}' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 10 | |
- name: Build | |
env: | |
TARGET: build | |
run: | | |
docker compose build bionic | |
- name: Test | |
env: | |
TARGET: test | |
run: | | |
docker compose build bionic | |
- name: Package | |
env: | |
TARGET: package | |
run: | | |
docker compose build bionic | |
docker compose up bionic | |
- name: Upload tar.gz package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: targz | |
path: output/*.tar.gz | |
- name: Upload DEB package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: deb | |
path: output/*.deb | |
- name: Upload rpm package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: rpm | |
path: output/*.rpm | |
test: | |
name: test | |
runs-on: ubuntu-latest | |
needs: [ build ] | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { container: 'ubuntu:18.04' } | |
- { container: 'ubuntu:20.04' } | |
- { container: 'ubuntu:22.04' } | |
- { container: 'ubuntu:24.04' } | |
- { container: 'debian:11' } | |
- { container: 'debian:12' } | |
- { container: 'almalinux:8' } | |
- { container: 'almalinux:9' } | |
- { container: 'rockylinux:8' } | |
- { container: 'rockylinux:9' } | |
- { container: 'redhat/ubi8' } | |
- { container: 'redhat/ubi9' } | |
- { container: 'opensuse/leap:15.5' } | |
- { container: 'opensuse/leap:15.6' } | |
- { container: 'fedora:39' } | |
- { container: 'fedora:40' } | |
- { container: 'fedora:41' } | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 10 | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: output | |
merge-multiple: true | |
- name: Test | |
env: | |
R_VERSION: '${{ github.event.inputs.rversion }}' | |
CONTAINER: ${{ matrix.config.container }} | |
run: | | |
rm -f output/*aarch64* output/*arm64* | |
docker compose build test | |
deploy: | |
name: deploy | |
if: ${{ github.event.inputs.deploy == '' || github.event.inputs.deploy == 'yes' }} | |
runs-on: ubuntu-latest | |
needs: [ test ] | |
steps: | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: output | |
merge-multiple: true | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
repository: r-hub/R | |
token: ${{ secrets.DEPLOY_TOKEN }} | |
files: | | |
output/*amd64.deb | |
output/*x86_64.rpm | |
output/*x86_64.tar.gz | |
name: '${{ github.event.inputs.rversion }}' | |
tag_name: 'v${{ github.event.inputs.rversion }}' | |
buildarm: | |
name: build (aarch64) | |
if: ${{ github.event.inputs.buildarm == '' || github.event.inputs.buildarm == 'yes' }} | |
runs-on: [self-hosted, linux, ARM64] | |
container: | |
image: "ubuntu:22.04" | |
volumes: | |
- ${{ github.workspace }}:/${{ github.workspace }} | |
env: | |
R_VERSION: '${{ github.event.inputs.rversion }}' | |
steps: | |
- name: Install Docker, git | |
run: | | |
apt-get update && apt-get install -y docker.io docker-compose-v2 git | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 10 | |
- name: Build | |
env: | |
TARGET: build | |
run: | | |
docker compose build bionic | |
- name: Test | |
env: | |
TARGET: test | |
run: | | |
docker compose build bionic | |
- name: Package | |
env: | |
TARGET: package | |
run: | | |
cd ${{ github.workspace }} | |
docker compose build bionic | |
docker compose up bionic | |
- name: Upload tar.gz package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: targzarm | |
path: output/*.tar.gz | |
- name: Upload DEB package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: debarm | |
path: output/*.deb | |
- name: Upload rpm package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: rpmarm | |
path: output/*.rpm | |
testarm: | |
name: test (aarch64) | |
runs-on: [self-hosted, linux, ARM64] | |
needs: [ buildarm ] | |
container: | |
image: "ubuntu:22.04" | |
volumes: | |
- ${{ github.workspace }}:/${{ github.workspace }} | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { container: 'ubuntu:18.04' } | |
- { container: 'ubuntu:20.04' } | |
- { container: 'ubuntu:22.04' } | |
- { container: 'ubuntu:24.04' } | |
- { container: 'debian:11' } | |
- { container: 'debian:12' } | |
- { container: 'almalinux:8' } | |
- { container: 'almalinux:9' } | |
- { container: 'rockylinux:8' } | |
- { container: 'rockylinux:9' } | |
# - { container: 'redhat/ubi8' } | |
# - { container: 'redhat/ubi9' } | |
- { container: 'opensuse/leap:15.5' } | |
- { container: 'opensuse/leap:15.6' } | |
- { container: 'fedora:39' } | |
- { container: 'fedora:40' } | |
- { container: 'fedora:41' } | |
steps: | |
- name: Install Docker, git | |
run: | | |
apt-get update && apt-get install -y docker.io docker-compose-v2 git | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 10 | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: output | |
merge-multiple: true | |
- name: Test | |
env: | |
R_VERSION: '${{ github.event.inputs.rversion }}' | |
CONTAINER: ${{ matrix.config.container }} | |
run: | | |
rm -f output/*x86_64* output/*amd64* | |
docker compose build test | |
deployarm: | |
name: deploy (aarch64) | |
if: ${{ github.event.inputs.deployarm == '' || github.event.inputs.deployarm == 'yes' }} | |
runs-on: [self-hosted, linux, ARM64] | |
needs: [ testarm ] | |
container: | |
image: "ubuntu:22.04" | |
volumes: | |
- ${{ github.workspace }}:/${{ github.workspace }} | |
steps: | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: output | |
merge-multiple: true | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
repository: r-hub/R | |
token: ${{ secrets.DEPLOY_TOKEN }} | |
files: | | |
output/*arm64.deb | |
output/*aarch64.rpm | |
output/*aarch64.tar.gz | |
name: "R ${{ github.event.inputs.rversion }}" | |
tag_name: 'v${{ github.event.inputs.rversion }}' |