-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add riscv-gcc-install action, correct lint-license tool path (#7)
* lint-license: Fixes to README * riscv-gcc-install: Add action * lint-license: Use runner temp directory for tool download * riscv-gcc-install: Fix path fragment * README: Add recommendations for existing actions * riscv-gcc-install: Fix README example
- Loading branch information
Showing
5 changed files
with
80 additions
and
5 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# RISC-V GCC install | ||
|
||
This action downloads and installs a nightly build of the RISC-V GCC toolchain provided [here](https://github.com/riscv-collab/riscv-gnu-toolchain/releases). Not that as of writing, only Ubuntu LTS builds are provided. | ||
|
||
## Action usage | ||
|
||
Simply add the action to your desired upstream workflow. You can specify the `distro`, `nightly-date`, and `target`, which all have sensible defaults. Here is an example workflow using this action: | ||
|
||
```yaml | ||
name: riscv-gcc-install | ||
|
||
on: [ push, pull_request, workflow_dispatch ] | ||
|
||
jobs: | ||
riscv-gcc-install: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: RISC-V GCC install | ||
uses: pulp-platform/pulp-actions/riscv-gcc-install@v2 | ||
with: | ||
distro: ubuntu-22.04 | ||
nightly-date: '2023.03.14' | ||
target: riscv64-elf | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Copyright 2023 ETH Zurich and University of Bologna. | ||
# Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Author: Paul Scheffler <[email protected]> | ||
|
||
name: 'RISC-V GCC install' | ||
description: 'Installs a nightly build of the RISC-V GCC toolchain.' | ||
|
||
inputs: | ||
# Optional arguments (sensible defaults below) | ||
nightly-date: | ||
description: 'Date of nightly release (default: 2023.03.14)' | ||
required: true | ||
default: '2023.03.14' | ||
distro: | ||
description: 'Identifier of distribution (default: ubuntu-22.04)' | ||
required: true | ||
default: 'ubuntu-22.04' | ||
target: | ||
description: 'Target architecture and platform (default: riscv64-elf)' | ||
required: true | ||
default: 'riscv64-elf' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install RISC-V GCC toolchain | ||
shell: bash | ||
run: | | ||
RISCV_GCC_PATH=${{ runner.temp }}/pulp-actions/riscv-gcc-install | ||
mkdir -p ${RISCV_GCC_PATH} | ||
cd ${RISCV_GCC_PATH} | ||
RISCV_GCC_NAME=riscv-gcc-${{ inputs.nightly-date }}-${{ inputs.distro }}-${{ inputs.target }} | ||
curl -Ls -o ${RISCV_GCC_NAME}.tar.gz https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/${{ inputs.nightly-date }}/${{ inputs.target }}-${{ inputs.distro }}-nightly-${{ inputs.nightly-date }}-nightly.tar.gz | ||
sudo chmod 777 ${RISCV_GCC_NAME}.tar.gz | ||
sudo mkdir -p ${RISCV_GCC_NAME} && sudo chmod 777 ${RISCV_GCC_NAME} | ||
tar -C ${RISCV_GCC_NAME} -xf ${RISCV_GCC_NAME}.tar.gz --strip-components=1 | ||
rm ${RISCV_GCC_NAME}.tar.gz | ||
echo "PATH=$PATH:${RISCV_GCC_PATH}/${RISCV_GCC_NAME}/bin" >> ${GITHUB_ENV} |