build.yaml #7
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: | |
test: | |
description: 'Run tests' | |
required: true | |
type: choice | |
options: | |
- 'yes' | |
- 'no' | |
default: 'yes' | |
deploy: | |
description: 'Deploy packages after testing' | |
required: true | |
type: choice | |
options: | |
- 'yes' | |
- 'no' | |
default: 'no' | |
jobs: | |
build: | |
name: build | |
runs-on: ubuntu-latest | |
env: | |
R_VERSION: '4.4.2' | |
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 | |
if: ${{ github.event.inputs.test == '' || github.event.inputs.test == 'yes' }} | |
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: List artifacts | |
run: | | |
ls -l | |
find . | |
shell: bash | |
- name: Test | |
run: | | |
R_VERSION=4.4.2 CONTAINER=${{ matrix.config.container }} 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/*.deb | |
output/*.rpm | |
output/*.tar.gz | |
name: "R 4.4.2" | |
tag_name: v4.4.2 |