Compare commits
11 Commits
2025.08.28
...
master
Author | SHA1 | Date |
---|---|---|
![]() |
357800bf2c | |
![]() |
621e2908e1 | |
![]() |
9ca54e7ad9 | |
![]() |
8094d3edc8 | |
![]() |
ff49d85c38 | |
![]() |
3b011cffdc | |
![]() |
19dd147bdc | |
![]() |
61890b868c | |
![]() |
6f560d9097 | |
![]() |
cfe9d78f8d | |
![]() |
1faa77ffe8 |
|
@ -0,0 +1,199 @@
|
||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
artifact-name:
|
||||||
|
description: "Named identifier for the artifact, optional"
|
||||||
|
type: string
|
||||||
|
os:
|
||||||
|
description: "OS list"
|
||||||
|
type: string
|
||||||
|
default: '["ubuntu-22.04","ubuntu-24.04"]'
|
||||||
|
mode:
|
||||||
|
description: "Mode list"
|
||||||
|
type: string
|
||||||
|
default: '["newlib","linux","musl","uclibc"]'
|
||||||
|
target:
|
||||||
|
description: "Target list"
|
||||||
|
type: string
|
||||||
|
default: '["rv32gc-ilp32d","rv64gc-lp64d"]'
|
||||||
|
compiler:
|
||||||
|
description: "Compiler list"
|
||||||
|
type: string
|
||||||
|
default: '["gcc","llvm"]'
|
||||||
|
cmodel:
|
||||||
|
description: "C model list"
|
||||||
|
type: string
|
||||||
|
default: '[""]'
|
||||||
|
languages:
|
||||||
|
description: "Languages list"
|
||||||
|
type: string
|
||||||
|
default: '[""]'
|
||||||
|
sim:
|
||||||
|
description: "Simulator"
|
||||||
|
type: string
|
||||||
|
default: '[""]'
|
||||||
|
|
||||||
|
env:
|
||||||
|
submodule_paths: |
|
||||||
|
binutils
|
||||||
|
dejagnu
|
||||||
|
gcc
|
||||||
|
gdb
|
||||||
|
glibc
|
||||||
|
llvm
|
||||||
|
musl
|
||||||
|
newlib
|
||||||
|
pk
|
||||||
|
qemu
|
||||||
|
spike
|
||||||
|
uclibc-ng
|
||||||
|
.git/modules
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
report:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Report inputs
|
||||||
|
run: |
|
||||||
|
echo "Artifact name: ${{ inputs.artifact-name }}"
|
||||||
|
echo "OS list: ${{ inputs.os }}"
|
||||||
|
echo "Mode list: ${{ inputs.mode }}"
|
||||||
|
echo "Target list: ${{ inputs.target }}"
|
||||||
|
echo "Compiler list: ${{ inputs.compiler }}"
|
||||||
|
echo "C model list: ${{ inputs.cmodel }}"
|
||||||
|
echo "Languages list: ${{ inputs.languages }}"
|
||||||
|
echo "Simulator: ${{ inputs.sim }}"
|
||||||
|
|
||||||
|
submodule_cache:
|
||||||
|
name: Initialize submodule cache
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
key: ${{ steps.keygen.outputs.smcache_key }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Remove unneeded frameworks to recover disk space
|
||||||
|
run: sudo ./.github/cleanup-rootfs.sh
|
||||||
|
|
||||||
|
- name: Generate submodule cache key
|
||||||
|
id: keygen
|
||||||
|
run: echo "smcache_key=smcache-$(printf $(git submodule | sha1sum))" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Setup submodule cache
|
||||||
|
id: smcache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ${{ env.submodule_paths }}
|
||||||
|
key: ${{ steps.keygen.outputs.smcache_key }}
|
||||||
|
|
||||||
|
- name: Checkout required submodules
|
||||||
|
if: steps.smcache.outputs.cache-hit != 'true'
|
||||||
|
run: git submodule update --init -j $(nproc) --depth 1 $(echo ${submodule_paths} | sed '$d' | tr '\n' ' ')
|
||||||
|
|
||||||
|
- name: Storage size optimization
|
||||||
|
if: steps.smcache.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
git submodule foreach 'git maintenance run'
|
||||||
|
|
||||||
|
build:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
needs: [submodule_cache]
|
||||||
|
env:
|
||||||
|
smcache_key: ${{ needs.submodule_cache.outputs.key }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: ${{ fromJSON(inputs.os) }}
|
||||||
|
mode: ${{ fromJSON(inputs.mode) }}
|
||||||
|
target: ${{ fromJSON(inputs.target) }}
|
||||||
|
compiler: ${{ fromJSON(inputs.compiler) }}
|
||||||
|
sim: ${{ fromJSON(inputs.sim) }}
|
||||||
|
cmodel: ${{ fromJSON(inputs.cmodel) }}
|
||||||
|
languages: ${{ fromJSON(inputs.languages) }}
|
||||||
|
|
||||||
|
exclude:
|
||||||
|
- mode: musl
|
||||||
|
compiler: llvm
|
||||||
|
- mode: uclibc
|
||||||
|
compiler: llvm
|
||||||
|
outputs:
|
||||||
|
toolchain-name: ${{ steps.toolchain-name-generator.outputs.TOOLCHAIN_NAME }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Remove unneeded frameworks to recover disk space
|
||||||
|
run: sudo ./.github/cleanup-rootfs.sh
|
||||||
|
|
||||||
|
- name: install dependencies
|
||||||
|
run: sudo ./.github/setup-apt.sh
|
||||||
|
|
||||||
|
- name: Load submodule cache
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
path: ${{ env.submodule_paths }}
|
||||||
|
key: ${{ env.smcache_key }}
|
||||||
|
|
||||||
|
- name: build toolchain
|
||||||
|
run: |
|
||||||
|
TARGET_TUPLE=($(echo ${{ matrix.target }} | tr "-" "\n"))
|
||||||
|
BUILD_TOOLCHAIN="./configure --prefix=/mnt/riscv --with-arch=${TARGET_TUPLE[0]} --with-abi=${TARGET_TUPLE[1]}"
|
||||||
|
ARGS=""
|
||||||
|
if [ "${{ matrix.compiler }}" == "llvm" ]; then # build toolchain with llvm
|
||||||
|
ARGS="$ARGS --enable-llvm"
|
||||||
|
fi
|
||||||
|
if [ -n "${{ matrix.sim }}" ]; then
|
||||||
|
ARGS="$ARGS --with-sim=${{ matrix.sim }}"
|
||||||
|
fi
|
||||||
|
if [ -n "${{ matrix.cmodel }}" ]; then
|
||||||
|
ARGS="$ARGS --with-cmodel=${{ matrix.cmodel }}"
|
||||||
|
fi
|
||||||
|
if [ -n "${{ matrix.languages }}" ]; then
|
||||||
|
ARGS="$ARGS --enable-languages=${{ matrix.languages }}"
|
||||||
|
fi
|
||||||
|
$BUILD_TOOLCHAIN $ARGS
|
||||||
|
sudo mkdir /mnt/riscv
|
||||||
|
sudo chown runner:runner /mnt/riscv
|
||||||
|
make -j $(nproc) ${{ matrix.mode }}
|
||||||
|
|
||||||
|
- name: tarball build
|
||||||
|
run: |
|
||||||
|
du -s -h /mnt/riscv
|
||||||
|
./.github/dedup-dir.sh /mnt/riscv/
|
||||||
|
XZ_OPT="-e -T0" tar cJvf riscv.tar.xz -C /mnt/ riscv/
|
||||||
|
|
||||||
|
- name: make report
|
||||||
|
if: |
|
||||||
|
matrix.os == 'ubuntu-24.04'
|
||||||
|
&& (matrix.mode == 'linux' || matrix.mode == 'newlib')
|
||||||
|
&& matrix.compiler == 'gcc'
|
||||||
|
run: |
|
||||||
|
make report-${{ matrix.mode }} -j $(nproc)
|
||||||
|
|
||||||
|
- name: generate prebuilt toolchain name
|
||||||
|
id: toolchain-name-generator
|
||||||
|
run: |
|
||||||
|
if [[ "${{ matrix.target }}" == *"32"* ]]; then BITS=32; else BITS=64; fi
|
||||||
|
case "${{ matrix.mode }}" in
|
||||||
|
"linux")
|
||||||
|
MODE="glibc";;
|
||||||
|
"musl")
|
||||||
|
MODE="musl";;
|
||||||
|
"uclibc")
|
||||||
|
MODE="uclibc-ng";;
|
||||||
|
*)
|
||||||
|
MODE="elf";;
|
||||||
|
esac
|
||||||
|
ARTIFACT_NAME=${{ inputs.artifact-name }}
|
||||||
|
if [ -n "$ARTIFACT_NAME" ]; then
|
||||||
|
ARTIFACT_NAME="-${ARTIFACT_NAME}"
|
||||||
|
fi
|
||||||
|
echo "TOOLCHAIN_NAME=riscv$BITS-$MODE-${{ matrix.os }}-${{ matrix.compiler }}${ARTIFACT_NAME}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Move output to representative name
|
||||||
|
run: |
|
||||||
|
mv riscv.tar.xz ${{ steps.toolchain-name-generator.outputs.TOOLCHAIN_NAME }}.tar.xz
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ steps.toolchain-name-generator.outputs.TOOLCHAIN_NAME }}
|
||||||
|
path: ${{ steps.toolchain-name-generator.outputs.TOOLCHAIN_NAME }}.tar.xz
|
|
@ -9,231 +9,27 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
env:
|
|
||||||
submodule_paths: |
|
|
||||||
binutils
|
|
||||||
dejagnu
|
|
||||||
gcc
|
|
||||||
gdb
|
|
||||||
glibc
|
|
||||||
llvm
|
|
||||||
musl
|
|
||||||
newlib
|
|
||||||
pk
|
|
||||||
qemu
|
|
||||||
spike
|
|
||||||
uclibc-ng
|
|
||||||
.git/modules
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
submodule_cache:
|
|
||||||
name: Initialize submodule cache
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
key: ${{ steps.keygen.outputs.smcache_key }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Remove unneeded frameworks to recover disk space
|
|
||||||
run: sudo ./.github/cleanup-rootfs.sh
|
|
||||||
|
|
||||||
- name: Generate submodule cache key
|
|
||||||
id: keygen
|
|
||||||
run: echo "smcache_key=smcache-$(printf $(git submodule | sha1sum))" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Setup submodule cache
|
|
||||||
id: smcache
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: ${{ env.submodule_paths }}
|
|
||||||
key: ${{ steps.keygen.outputs.smcache_key }}
|
|
||||||
|
|
||||||
- name: Checkout required submodules
|
|
||||||
if: steps.smcache.outputs.cache-hit != 'true'
|
|
||||||
run: git submodule update --init -j $(nproc) --depth 1 $(echo ${submodule_paths} | sed '$d' | tr '\n' ' ')
|
|
||||||
|
|
||||||
- name: Storage size optimization
|
|
||||||
if: steps.smcache.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
|
||||||
git submodule foreach 'git maintenance run'
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: ${{ matrix.os }}
|
uses: ./.github/workflows/build-reusable.yaml
|
||||||
needs: [submodule_cache]
|
with:
|
||||||
env:
|
artifact-name: build
|
||||||
smcache_key: ${{ needs.submodule_cache.outputs.key }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-22.04, ubuntu-24.04]
|
|
||||||
mode: [newlib, linux, musl, uclibc]
|
|
||||||
target: [rv32gc-ilp32d, rv64gc-lp64d]
|
|
||||||
compiler: [gcc, llvm]
|
|
||||||
exclude:
|
|
||||||
- mode: musl
|
|
||||||
compiler: llvm
|
|
||||||
- mode: uclibc
|
|
||||||
compiler: llvm
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Remove unneeded frameworks to recover disk space
|
|
||||||
run: sudo ./.github/cleanup-rootfs.sh
|
|
||||||
|
|
||||||
- name: install dependencies
|
|
||||||
run: sudo ./.github/setup-apt.sh
|
|
||||||
|
|
||||||
- name: Load submodule cache
|
|
||||||
uses: actions/cache/restore@v4
|
|
||||||
with:
|
|
||||||
path: ${{ env.submodule_paths }}
|
|
||||||
key: ${{ env.smcache_key }}
|
|
||||||
|
|
||||||
- name: build toolchain
|
|
||||||
run: |
|
|
||||||
TARGET_TUPLE=($(echo ${{ matrix.target }} | tr "-" "\n"))
|
|
||||||
BUILD_TOOLCHAIN="./configure --prefix=/mnt/riscv --with-arch=${TARGET_TUPLE[0]} --with-abi=${TARGET_TUPLE[1]}"
|
|
||||||
if [ "${{ matrix.compiler }}" == "llvm" ]; then # build toolchain with llvm
|
|
||||||
$BUILD_TOOLCHAIN --enable-llvm
|
|
||||||
else
|
|
||||||
$BUILD_TOOLCHAIN
|
|
||||||
fi
|
|
||||||
sudo mkdir /mnt/riscv
|
|
||||||
sudo chown runner:runner /mnt/riscv
|
|
||||||
make -j $(nproc) ${{ matrix.mode }}
|
|
||||||
|
|
||||||
- name: tarball build
|
|
||||||
run: |
|
|
||||||
du -s -h /mnt/riscv
|
|
||||||
./.github/dedup-dir.sh /mnt/riscv/
|
|
||||||
XZ_OPT="-e -T0" tar cJvf riscv.tar.xz -C /mnt/ riscv/
|
|
||||||
|
|
||||||
- name: make report
|
|
||||||
if: |
|
|
||||||
matrix.os == 'ubuntu-24.04'
|
|
||||||
&& (matrix.mode == 'linux' || matrix.mode == 'newlib')
|
|
||||||
&& matrix.compiler == 'gcc'
|
|
||||||
run: |
|
|
||||||
make report-${{ matrix.mode }} -j $(nproc)
|
|
||||||
|
|
||||||
- name: generate prebuilt toolchain name
|
|
||||||
id: toolchain-name-generator
|
|
||||||
run: |
|
|
||||||
if [[ "${{ matrix.target }}" == *"32"* ]]; then BITS=32; else BITS=64; fi
|
|
||||||
case "${{ matrix.mode }}" in
|
|
||||||
"linux")
|
|
||||||
MODE="glibc";;
|
|
||||||
"musl")
|
|
||||||
MODE="musl";;
|
|
||||||
"uclibc")
|
|
||||||
MODE="uclibc-ng";;
|
|
||||||
*)
|
|
||||||
MODE="elf";;
|
|
||||||
esac
|
|
||||||
echo "TOOLCHAIN_NAME=riscv$BITS-$MODE-${{ matrix.os }}-${{ matrix.compiler }}-nightly" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ steps.toolchain-name-generator.outputs.TOOLCHAIN_NAME }}
|
|
||||||
path: riscv.tar.xz
|
|
||||||
|
|
||||||
test-sim:
|
test-sim:
|
||||||
runs-on: ${{ matrix.os }}
|
uses: ./.github/workflows/build-reusable.yaml
|
||||||
needs: [submodule_cache]
|
with:
|
||||||
env:
|
artifact-name: sim
|
||||||
smcache_key: ${{ needs.submodule_cache.outputs.key }}
|
os: '["ubuntu-24.04"]'
|
||||||
strategy:
|
mode: '["newlib"]'
|
||||||
matrix:
|
target: '["rv64gc-lp64d"]'
|
||||||
os: [ubuntu-24.04]
|
sim: '["spike"]'
|
||||||
mode: [newlib]
|
|
||||||
target: [rv64gc-lp64d]
|
|
||||||
sim: [spike]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Remove unneeded frameworks to recover disk space
|
|
||||||
run: sudo ./.github/cleanup-rootfs.sh
|
|
||||||
|
|
||||||
- name: install dependencies
|
|
||||||
run: sudo ./.github/setup-apt.sh
|
|
||||||
|
|
||||||
- name: Load submodule cache
|
|
||||||
uses: actions/cache/restore@v4
|
|
||||||
with:
|
|
||||||
path: ${{ env.submodule_paths }}
|
|
||||||
key: ${{ env.smcache_key }}
|
|
||||||
|
|
||||||
- name: build toolchain
|
|
||||||
run: |
|
|
||||||
TARGET_TUPLE=($(echo ${{ matrix.target }} | tr "-" "\n"))
|
|
||||||
./configure --prefix=/mnt/riscv --with-arch=${TARGET_TUPLE[0]} --with-abi=${TARGET_TUPLE[1]} --with-sim=${{ matrix.sim }}
|
|
||||||
sudo mkdir /mnt/riscv
|
|
||||||
sudo chown runner:runner /mnt/riscv
|
|
||||||
make -j $(nproc) ${{ matrix.mode }}
|
|
||||||
|
|
||||||
- name: make report
|
|
||||||
run: make report-${{ matrix.mode }} -j $(nproc)
|
|
||||||
|
|
||||||
build-multilib:
|
build-multilib:
|
||||||
if: ${{ false }} # Disable until multilib errors are triaged
|
if: ${{ false }} # Disable until multilib errors are triaged
|
||||||
runs-on: ${{ matrix.os }}
|
uses: ./.github/workflows/build-reusable.yaml
|
||||||
needs: [submodule_cache]
|
with:
|
||||||
env:
|
artifact-name: multilib
|
||||||
smcache_key: ${{ needs.submodule_cache.outputs.key }}
|
os: '["ubuntu-24.04"]'
|
||||||
strategy:
|
mode: '["newlib","linux"]'
|
||||||
matrix:
|
target: '["rv64gc-lp64d"]'
|
||||||
os: [ubuntu-24.04]
|
|
||||||
mode: [newlib, linux]
|
|
||||||
target: [rv64gc-lp64d]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Remove unneeded frameworks to recover disk space
|
|
||||||
run: sudo ./.github/cleanup-rootfs.sh
|
|
||||||
|
|
||||||
- name: install dependencies
|
|
||||||
run: sudo ./.github/setup-apt.sh
|
|
||||||
|
|
||||||
- name: Load submodule cache
|
|
||||||
uses: actions/cache/restore@v4
|
|
||||||
with:
|
|
||||||
path: ${{ env.submodule_paths }}
|
|
||||||
key: ${{ env.smcache_key }}
|
|
||||||
|
|
||||||
- name: build toolchain
|
|
||||||
run: |
|
|
||||||
TARGET_TUPLE=($(echo ${{ matrix.target }} | tr "-" "\n"))
|
|
||||||
./configure --prefix=/mnt/riscv --with-arch=${TARGET_TUPLE[0]} --with-abi=${TARGET_TUPLE[1]} --enable-multilib
|
|
||||||
sudo mkdir /mnt/riscv
|
|
||||||
sudo chown runner:runner /mnt/riscv
|
|
||||||
make -j $(nproc) ${{ matrix.mode }}
|
|
||||||
|
|
||||||
- name: tarball build
|
|
||||||
run: |
|
|
||||||
du -s -h /mnt/riscv
|
|
||||||
./.github/dedup-dir.sh /mnt/riscv/
|
|
||||||
XZ_OPT="-e -T0" tar cJvf riscv.tar.xz -C /mnt/ riscv/
|
|
||||||
|
|
||||||
- name: make report
|
|
||||||
run: |
|
|
||||||
make report-${{ matrix.mode }} -j $(nproc)
|
|
||||||
|
|
||||||
- name: generate prebuilt toolchain name
|
|
||||||
id: toolchain-name-generator
|
|
||||||
run: |
|
|
||||||
if [[ "${{ matrix.target }}" == *"32"* ]]; then BITS=32; else BITS=64; fi
|
|
||||||
case "${{ matrix.mode }}" in
|
|
||||||
"linux")
|
|
||||||
MODE="glibc";;
|
|
||||||
"musl")
|
|
||||||
MODE="musl";;
|
|
||||||
"uclibc")
|
|
||||||
MODE="uclibc-ng";;
|
|
||||||
*)
|
|
||||||
MODE="elf";;
|
|
||||||
esac
|
|
||||||
echo "TOOLCHAIN_NAME=riscv$BITS-$MODE-${{ matrix.os }}-multilib-nightly" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ steps.toolchain-name-generator.outputs.TOOLCHAIN_NAME }}
|
|
||||||
path: riscv.tar.xz
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ name: Nightly Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 0 * * ?'
|
- cron: '0 0 * * *'
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
@ -12,28 +12,37 @@ jobs:
|
||||||
outputs:
|
outputs:
|
||||||
stale: ${{ steps.activity_check.outputs.stale }}
|
stale: ${{ steps.activity_check.outputs.stale }}
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
- name: Activity check
|
- name: Activity check
|
||||||
id: activity_check
|
id: activity_check
|
||||||
run: |
|
run: |
|
||||||
curl -sL https://api.github.com/repos/$GITHUB_REPOSITORY/commits | jq -r '[.[]][0]' > $HOME/commit.json
|
# get the author and timestamp of the latest commit
|
||||||
date="$(jq -r '.commit.committer.date' $HOME/commit.json)"
|
AUTHOR=$(git log -1 --pretty=format:'%an')
|
||||||
timestamp=$(date --utc -d "$date" +%s)
|
# Get the commit date in ISO 8601 format (UTC)
|
||||||
author="$(jq -r '.commit.author.name' $HOME/commit.json)"
|
COMMIT_DATE=$(git log -1 --pretty=format:'%cI')
|
||||||
url="$(jq -r '.html_url' $HOME/commit.json)"
|
echo "Commit date: $COMMIT_DATE"
|
||||||
hours=$(( ( $(date --utc +%s) - $timestamp ) / 3600 ))
|
# Convert both dates to epoch seconds
|
||||||
rm -f $HOME/commit.json
|
COMMIT_EPOCH=$(date -d "$COMMIT_DATE" +%s)
|
||||||
echo "Latest Repository activity : $timestamp $author $url"
|
NOW_EPOCH=$(date -u +%s)
|
||||||
|
|
||||||
|
# Calculate difference in seconds
|
||||||
|
AGE_SECONDS=$(( NOW_EPOCH - COMMIT_EPOCH ))
|
||||||
|
|
||||||
|
# 86400 seconds = 24 hours
|
||||||
|
echo "Latest Repository activity : $COMMIT_DATE $AUTHOR, $AGE_SECONDS seconds ago"
|
||||||
|
|
||||||
STALE=false
|
STALE=false
|
||||||
if [ "${{ github.event_name }}" == "repository_dispatch" ]; then
|
if [ "${{ github.event_name }}" == "repository_dispatch" ]; then
|
||||||
echo "[WARNING] Ignoring activity limits : workflow triggered manually"
|
echo "[WARNING] Ignoring activity limits : workflow triggered manually"
|
||||||
|
STALE=false
|
||||||
|
elif [ "$AGE_SECONDS" -gt 86400 ]; then
|
||||||
|
echo "[ERROR] Repository not updated : event<${{ github.event_name }}> not allowed to modify stale repository"
|
||||||
|
echo "Commit is stale (older than 24 hours)"
|
||||||
|
STALE=true
|
||||||
else
|
else
|
||||||
echo Repository active last $hours hours ago
|
echo "Commit is fresh (within last 24 hours)"
|
||||||
if [ $hours -ge 24 ]; then
|
STALE=false
|
||||||
echo "[ERROR] Repository not updated : event<${{ github.event_name }}> not allowed to modify stale repository"
|
fi
|
||||||
STALE=true
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
echo "stale=$STALE" >> $GITHUB_OUTPUT
|
echo "stale=$STALE" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
if [ "$STALE" == "true" ]; then
|
if [ "$STALE" == "true" ]; then
|
||||||
|
@ -41,180 +50,50 @@ jobs:
|
||||||
fi
|
fi
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
needs: activity-check
|
needs: [activity-check]
|
||||||
if: needs.activity-check.outputs.stale != 'true'
|
if: needs.activity-check.outputs.stale != 'true'
|
||||||
runs-on: ${{ matrix.os }}
|
uses: ./.github/workflows/build-reusable.yaml
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-22.04, ubuntu-24.04]
|
|
||||||
mode: [newlib, linux, musl, uclibc]
|
|
||||||
target: [rv32gc-ilp32d, rv64gc-lp64d]
|
|
||||||
compiler: [gcc, llvm]
|
|
||||||
exclude:
|
|
||||||
- mode: musl
|
|
||||||
compiler: llvm
|
|
||||||
|
|
||||||
- mode: uclibc
|
|
||||||
compiler: llvm
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Remove unneeded frameworks to recover disk space
|
|
||||||
run: sudo ./.github/cleanup-rootfs.sh
|
|
||||||
|
|
||||||
- name: install apt dependencies
|
|
||||||
run: sudo ./.github/setup-apt.sh
|
|
||||||
|
|
||||||
- name: build toolchain
|
|
||||||
run: |
|
|
||||||
TARGET_TUPLE=($(echo ${{ matrix.target }} | tr "-" "\n"))
|
|
||||||
BUILD_TOOLCHAIN="./configure --prefix=/mnt/riscv --with-arch=${TARGET_TUPLE[0]} --with-abi=${TARGET_TUPLE[1]}"
|
|
||||||
if [ "${{ matrix.compiler }}" == "llvm" ]; then # build toolchain with llvm
|
|
||||||
$BUILD_TOOLCHAIN --enable-llvm
|
|
||||||
else
|
|
||||||
$BUILD_TOOLCHAIN
|
|
||||||
fi
|
|
||||||
sudo mkdir /mnt/riscv
|
|
||||||
sudo chown runner:runner /mnt/riscv
|
|
||||||
make -j $(nproc) ${{ matrix.mode }}
|
|
||||||
|
|
||||||
- name: tarball build
|
|
||||||
run: |
|
|
||||||
du -s -h /mnt/riscv
|
|
||||||
./.github/dedup-dir.sh /mnt/riscv/
|
|
||||||
XZ_OPT="-e -T0" tar cJvf riscv.tar.xz -C /mnt/ riscv/
|
|
||||||
|
|
||||||
- name: generate prebuilt toolchain name
|
|
||||||
id: toolchain-name-generator
|
|
||||||
run: |
|
|
||||||
if [[ "${{ matrix.target }}" == *"32"* ]]; then BITS=32; else BITS=64; fi
|
|
||||||
case "${{ matrix.mode }}" in
|
|
||||||
"linux")
|
|
||||||
MODE="glibc";;
|
|
||||||
"musl")
|
|
||||||
MODE="musl";;
|
|
||||||
"uclibc")
|
|
||||||
MODE="uclibc-ng";;
|
|
||||||
*)
|
|
||||||
MODE="elf";;
|
|
||||||
esac
|
|
||||||
echo "TOOLCHAIN_NAME=riscv$BITS-$MODE-${{ matrix.os }}-${{ matrix.compiler }}-nightly" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ steps.toolchain-name-generator.outputs.TOOLCHAIN_NAME }}
|
|
||||||
path: riscv.tar.xz
|
|
||||||
|
|
||||||
|
|
||||||
create-release:
|
create-release:
|
||||||
needs: build
|
needs: [build]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
asset_matrix: ${{ steps.asset_names.outputs.asset_matrix }}
|
|
||||||
datestamp: ${{ env.DATESTAMP }}
|
datestamp: ${{ env.DATESTAMP }}
|
||||||
|
env:
|
||||||
|
ARTIFACTS_DIR: artifacts
|
||||||
steps:
|
steps:
|
||||||
- name: Remove unneeded frameworks to recover disk space
|
|
||||||
run: |
|
|
||||||
echo "-- Before --"
|
|
||||||
df -h
|
|
||||||
sudo rm -rf /usr/share/dotnet
|
|
||||||
sudo rm -rf /usr/local/lib/android
|
|
||||||
echo "-- After --"
|
|
||||||
df -h
|
|
||||||
- name: Run Configuration Commands
|
- name: Run Configuration Commands
|
||||||
|
id: metadata
|
||||||
run: |
|
run: |
|
||||||
DATESTAMP="$(date --utc '+%Y.%m.%d')"
|
DATESTAMP="$(date --utc '+%Y.%m.%d')"
|
||||||
echo "Version: ${DATESTAMP}-nightly"
|
echo "Version: ${DATESTAMP}-nightly"
|
||||||
|
|
||||||
# Setup Artifacts Directory
|
|
||||||
ARTIFACTS_DIR="/mnt/artifacts/"
|
|
||||||
sudo mkdir -p $ARTIFACTS_DIR
|
|
||||||
sudo chown runner:runner $ARTIFACTS_DIR
|
|
||||||
|
|
||||||
# Setup environment variables
|
# Setup environment variables
|
||||||
echo "DATESTAMP=${DATESTAMP}" >> $GITHUB_ENV
|
echo "datestamp=${DATESTAMP}" >> $GITHUB_OUTPUT
|
||||||
echo "DATEWORD=$(date --utc '+%B %d, %Y')" >> $GITHUB_ENV
|
echo "dateword=$(date --utc '+%B %d, %Y')" >> $GITHUB_OUTPUT
|
||||||
echo "ARTIFACTS_DIR=${ARTIFACTS_DIR}" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Create Release
|
|
||||||
id: create_release
|
|
||||||
uses: actions/create-release@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
tag_name: ${{ env.DATESTAMP }}
|
|
||||||
release_name: "Nightly: ${{ env.DATEWORD }}"
|
|
||||||
body: |
|
|
||||||
**Automated Nightly Release**
|
|
||||||
${{ env.DATESTAMP }}-nightly
|
|
||||||
draft: false
|
|
||||||
prerelease: true
|
|
||||||
|
|
||||||
- name: Download Built Artifacts
|
- name: Download Built Artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ env.ARTIFACTS_DIR }}
|
path: ${{ env.ARTIFACTS_DIR }}
|
||||||
|
merge-multiple: true
|
||||||
# IMPORTANT: Each artifact must only have one file
|
- name: List downloaded artifacts
|
||||||
- name: Designate Asset Names
|
|
||||||
id: asset_names
|
|
||||||
run: |
|
run: |
|
||||||
ASSET_MATRIX=$(
|
echo "Contents of ${{ env.ARTIFACTS_DIR }}"
|
||||||
find ${ARTIFACTS_DIR} -mindepth 2 -maxdepth 2 -type f |
|
ls -R ${{ env.ARTIFACTS_DIR }}
|
||||||
awk '{
|
|
||||||
fs_n=split($0, fs, "/") # Split file paths
|
|
||||||
art_name=fs[fs_n-1] # Get artifact name
|
|
||||||
fname=fs[fs_n] # Get file name from the artifact
|
|
||||||
ext = substr(fs[fs_n], index(fs[fs_n],".")) # File Extension
|
|
||||||
|
|
||||||
print art_name ":" fname ":" ext # format <artifact name : artifact file : file extension>
|
- name: Create Release
|
||||||
}' |
|
id: create_release
|
||||||
jq -R -s -c 'split("\n") | .[:-1] | { # Split by newlines (remove last entry)
|
uses: softprops/action-gh-release@v2
|
||||||
include: [
|
|
||||||
.[] | split(":") | { # Put it in JSON format
|
|
||||||
artifact: .[0],
|
|
||||||
file: .[1],
|
|
||||||
extension: .[2]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}'
|
|
||||||
)
|
|
||||||
|
|
||||||
echo "asset_matrix=${ASSET_MATRIX}" >> $GITHUB_OUTPUT
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
|
|
||||||
upload-assets:
|
|
||||||
needs: create-release
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix: ${{ fromJson( needs.create-release.outputs.asset_matrix ) }}
|
|
||||||
name: upload ${{ matrix.artifact }}
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- name: Remove unneeded frameworks to recover disk space
|
|
||||||
run: |
|
|
||||||
echo "-- Before --"
|
|
||||||
df -h
|
|
||||||
sudo rm -rf /usr/share/dotnet
|
|
||||||
sudo rm -rf /usr/local/lib/android
|
|
||||||
echo "-- After --"
|
|
||||||
df -h
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.artifact }}
|
tag_name: ${{ steps.metadata.outputs.datestamp }}
|
||||||
|
name: "Nightly: ${{ steps.metadata.outputs.dateword }}"
|
||||||
- uses: actions/upload-release-asset@v1
|
body: |
|
||||||
env:
|
**Automated Nightly Release**
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
${{ steps.metadata.outputs.datestamp }}-nightly
|
||||||
with:
|
draft: false
|
||||||
upload_url: ${{ needs.create-release.outputs.upload_url }}
|
files: |
|
||||||
asset_path: ${{ matrix.file }}
|
${{ env.ARTIFACTS_DIR }}/*
|
||||||
asset_name: ${{ matrix.artifact }}-${{ needs.create-release.outputs.datestamp }}-nightly${{ matrix.extension }}
|
|
||||||
asset_content_type: application/x-xz
|
|
||||||
|
|
14
Makefile.in
14
Makefile.in
|
@ -383,6 +383,8 @@ stamps/build-binutils-linux: $(BINUTILS_SRCDIR) $(BINUTILS_SRC_GIT) $(PREPARATIO
|
||||||
--disable-sim \
|
--disable-sim \
|
||||||
--disable-libdecnumber \
|
--disable-libdecnumber \
|
||||||
--disable-readline \
|
--disable-readline \
|
||||||
|
$(WITH_ABI) \
|
||||||
|
$(WITH_ARCH) \
|
||||||
$(WITH_ISA_SPEC)
|
$(WITH_ISA_SPEC)
|
||||||
$(MAKE) -C $(notdir $@)
|
$(MAKE) -C $(notdir $@)
|
||||||
$(MAKE) -C $(notdir $@) $(INSTALL_TARGET)
|
$(MAKE) -C $(notdir $@) $(INSTALL_TARGET)
|
||||||
|
@ -556,6 +558,8 @@ stamps/build-binutils-linux-native: $(BINUTILS_SRCDIR) $(BINUTILS_SRC_GIT) stamp
|
||||||
--disable-sim \
|
--disable-sim \
|
||||||
--disable-libdecnumber \
|
--disable-libdecnumber \
|
||||||
--disable-readline \
|
--disable-readline \
|
||||||
|
$(WITH_ABI) \
|
||||||
|
$(WITH_ARCH) \
|
||||||
$(WITH_ISA_SPEC)
|
$(WITH_ISA_SPEC)
|
||||||
$(MAKE) -C $(notdir $@)
|
$(MAKE) -C $(notdir $@)
|
||||||
$(MAKE) -C $(notdir $@) $(INSTALL_TARGET)
|
$(MAKE) -C $(notdir $@) $(INSTALL_TARGET)
|
||||||
|
@ -614,6 +618,8 @@ stamps/build-binutils-newlib: $(BINUTILS_SRCDIR) $(BINUTILS_SRC_GIT) $(PREPARATI
|
||||||
--disable-sim \
|
--disable-sim \
|
||||||
--disable-libdecnumber \
|
--disable-libdecnumber \
|
||||||
--disable-readline \
|
--disable-readline \
|
||||||
|
$(WITH_ABI) \
|
||||||
|
$(WITH_ARCH) \
|
||||||
$(WITH_ISA_SPEC)
|
$(WITH_ISA_SPEC)
|
||||||
$(MAKE) -C $(notdir $@)
|
$(MAKE) -C $(notdir $@)
|
||||||
$(MAKE) -C $(notdir $@) $(INSTALL_TARGET)
|
$(MAKE) -C $(notdir $@) $(INSTALL_TARGET)
|
||||||
|
@ -807,6 +813,8 @@ stamps/build-binutils-musl: $(BINUTILS_SRCDIR) $(BINUTILS_SRC_GIT) $(PREPARATION
|
||||||
--disable-sim \
|
--disable-sim \
|
||||||
--disable-libdecnumber \
|
--disable-libdecnumber \
|
||||||
--disable-readline \
|
--disable-readline \
|
||||||
|
$(WITH_ABI) \
|
||||||
|
$(WITH_ARCH) \
|
||||||
$(WITH_ISA_SPEC)
|
$(WITH_ISA_SPEC)
|
||||||
$(MAKE) -C $(notdir $@)
|
$(MAKE) -C $(notdir $@)
|
||||||
$(MAKE) -C $(notdir $@) $(INSTALL_TARGET)
|
$(MAKE) -C $(notdir $@) $(INSTALL_TARGET)
|
||||||
|
@ -968,6 +976,8 @@ stamps/build-binutils-uclibc: $(BINUTILS_SRCDIR) $(BINUTILS_SRC_GIT) $(PREPARATI
|
||||||
--disable-sim \
|
--disable-sim \
|
||||||
--disable-libdecnumber \
|
--disable-libdecnumber \
|
||||||
--disable-readline \
|
--disable-readline \
|
||||||
|
$(WITH_ABI) \
|
||||||
|
$(WITH_ARCH) \
|
||||||
$(WITH_ISA_SPEC)
|
$(WITH_ISA_SPEC)
|
||||||
$(MAKE) -C $(notdir $@)
|
$(MAKE) -C $(notdir $@)
|
||||||
$(MAKE) -C $(notdir $@) $(INSTALL_TARGET)
|
$(MAKE) -C $(notdir $@) $(INSTALL_TARGET)
|
||||||
|
@ -1150,7 +1160,7 @@ stamps/build-llvm-linux: $(LLVM_SRCDIR) $(LLVM_SRC_GIT) $(BINUTILS_SRCDIR) $(BIN
|
||||||
-DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) \
|
-DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DLLVM_TARGETS_TO_BUILD="RISCV" \
|
-DLLVM_TARGETS_TO_BUILD="RISCV" \
|
||||||
-DLLVM_ENABLE_PROJECTS="clang;lld" \
|
-DLLVM_ENABLE_PROJECTS="llvm;clang;lld" \
|
||||||
-DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind" \
|
-DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind" \
|
||||||
-DLLVM_DEFAULT_TARGET_TRIPLE="$(LINUX_TUPLE)" \
|
-DLLVM_DEFAULT_TARGET_TRIPLE="$(LINUX_TUPLE)" \
|
||||||
-DDEFAULT_SYSROOT="../sysroot" \
|
-DDEFAULT_SYSROOT="../sysroot" \
|
||||||
|
@ -1215,7 +1225,7 @@ stamps/build-llvm-newlib: $(LLVM_SRCDIR) $(LLVM_SRC_GIT) $(BINUTILS_SRCDIR) $(BI
|
||||||
-DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) \
|
-DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DLLVM_TARGETS_TO_BUILD="RISCV" \
|
-DLLVM_TARGETS_TO_BUILD="RISCV" \
|
||||||
-DLLVM_ENABLE_PROJECTS="clang;lld" \
|
-DLLVM_ENABLE_PROJECTS="llvm;clang;lld" \
|
||||||
-DLLVM_DEFAULT_TARGET_TRIPLE="$(NEWLIB_TUPLE)" \
|
-DLLVM_DEFAULT_TARGET_TRIPLE="$(NEWLIB_TUPLE)" \
|
||||||
-DLLVM_INSTALL_TOOLCHAIN_ONLY=On \
|
-DLLVM_INSTALL_TOOLCHAIN_ONLY=On \
|
||||||
-DLLVM_BINUTILS_INCDIR=$(BINUTILS_SRCDIR)/include \
|
-DLLVM_BINUTILS_INCDIR=$(BINUTILS_SRCDIR)/include \
|
||||||
|
|
2
dejagnu
2
dejagnu
|
@ -1 +1 @@
|
||||||
Subproject commit 98d75813f06ff2b0bb0d721558fce51db7e9ca6e
|
Subproject commit 3ea7702a75a6b7a51a70a9e91c20eeff339ad007
|
2
llvm
2
llvm
|
@ -1 +1 @@
|
||||||
Subproject commit 87f0227cb60147a26a1eeb4fb06e3b505e9c7261
|
Subproject commit 5a86dc996c26299de63effc927075dcbfb924167
|
2
qemu
2
qemu
|
@ -1 +1 @@
|
||||||
Subproject commit 7c949c53e936aa3a658d84ab53bae5cadaa5d59c
|
Subproject commit 562020faa2ee9c531ce58434be01e3e42cfd94d6
|
Loading…
Reference in New Issue