-
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.
- Loading branch information
0 parents
commit a8e4b29
Showing
4 changed files
with
84 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM librecores/ci:2020.6-rc1 | ||
COPY entrypoint.py /tmp/entrypoint.py | ||
ENTRYPOINT [ "/tmp/entrypoint.py" ] |
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,33 @@ | ||
# LibreCores CI Github Action with FuseSoC | ||
|
||
This executes FuseSoC in the [LibreCores CI docker container](https://github.com/librecores/ci-docker-image). | ||
|
||
It is still in an early development phase, please feel free to open an issue with your suggestion! | ||
|
||
## Inputs | ||
|
||
### `core` | ||
|
||
**Required** The core/system identifier to execute on. | ||
|
||
### `flow` | ||
|
||
**Required** Command to execute, such as `build`, `run` etc. | ||
|
||
### `target` | ||
|
||
*Optional* Override default target, default none. | ||
|
||
### `tool` | ||
|
||
*Optional* Override default tool for target, default none. | ||
|
||
## Example usage | ||
|
||
```yaml | ||
uses: librecores/[email protected] | ||
with: | ||
core: myorg:mylib:mycore | ||
flow: run | ||
target: lint | ||
``` |
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,27 @@ | ||
name: 'LibreCores CI with FuseSoC' | ||
description: 'FuseSoC action on LibreCores CI' | ||
inputs: | ||
core: | ||
description: 'Core identifier' | ||
required: true | ||
default: '' | ||
flow: | ||
description: 'Flow to execute (build, run, ...)' | ||
required: true | ||
default: 'build' | ||
target: | ||
description: 'Target' | ||
required: false | ||
default: '' | ||
tool: | ||
description: 'Tool to use' | ||
required: false | ||
pre-run-command: | ||
description: 'Execute command before the run' | ||
required: false | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
branding: | ||
icon: 'cpu' | ||
color: 'green' |
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,21 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import subprocess | ||
import sys, os | ||
|
||
from fusesoc.main import main | ||
|
||
|
||
if __name__ == "__main__": | ||
args = ["fusesoc", "--cores-root", "."] | ||
args += [os.environ.get("INPUT_FLOW")] | ||
if "INPUT_TARGET" in os.environ: | ||
args += ["--target", os.environ.get("INPUT_TARGET")] | ||
if "INPUT_TOOL" in os.environ: | ||
args += ["--tool", os.environ.get("INPUT_TOOL")] | ||
args += [os.environ.get("INPUT_CORE")] | ||
|
||
if "INPUT_PRE-RUN-COMMAND" in os.environ: | ||
subprocess.call(os.environ.get("INPUT_PRE-RUN-COMMAND"), shell=True) | ||
sys.argv = args | ||
exit(main()) |