Skip to content

Commit

Permalink
Initial commit towards 2020.6
Browse files Browse the repository at this point in the history
  • Loading branch information
wallento committed Jun 14, 2020
0 parents commit a8e4b29
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
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" ]
33 changes: 33 additions & 0 deletions README.md
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
```
27 changes: 27 additions & 0 deletions action.yml
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'
21 changes: 21 additions & 0 deletions entrypoint.py
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())

0 comments on commit a8e4b29

Please sign in to comment.