Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 35 additions & 10 deletions .github/workflows/build-reusable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ on:
workflow_call:
inputs:
artifact-name:
description: "Named identifier for the artifact"
required: true
description: "Named identifier for the artifact, optional"
type: string
os:
description: "OS list"
Expand All @@ -23,6 +22,14 @@ on:
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
Expand Down Expand Up @@ -50,12 +57,14 @@ jobs:
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 "Simulator: ${{ inputs.sim }}"
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
Expand Down Expand Up @@ -100,6 +109,9 @@ jobs:
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
Expand Down Expand Up @@ -133,6 +145,12 @@ jobs:
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
Expand Down Expand Up @@ -166,9 +184,16 @@ jobs:
*)
MODE="elf";;
esac
echo "TOOLCHAIN_NAME=riscv$BITS-$MODE-${{ matrix.os }}-${{ matrix.compiler }}-${{ inputs.artifact-name }}" >> $GITHUB_OUTPUT
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: riscv.tar.xz
path: ${{ steps.toolchain-name-generator.outputs.TOOLCHAIN_NAME }}.tar.xz
5 changes: 2 additions & 3 deletions .github/workflows/nightly-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ jobs:
needs: [activity-check]
if: needs.activity-check.outputs.stale != 'true'
uses: ./.github/workflows/build-reusable.yaml
with:
artifact-name: nightly

create-release:
needs: [build]
Expand All @@ -65,7 +63,7 @@ jobs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
datestamp: ${{ env.DATESTAMP }}
env:
ARTIFACTS_DIR: /mnt/artifacts/
ARTIFACTS_DIR: artifacts
steps:
- name: Run Configuration Commands
id: metadata
Expand All @@ -81,6 +79,7 @@ jobs:
uses: actions/download-artifact@v4
with:
path: ${{ env.ARTIFACTS_DIR }}
merge-multiple: true
- name: List downloaded artifacts
run: |
echo "Contents of ${{ env.ARTIFACTS_DIR }}"
Expand Down