Repository navigation
[ci] Add CI checks #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
5b3cd6a
[hjson] Fix copyright header
raylau1 4d16d68
[nix] Add initial Nix flake
raylau1 5a9e71c
[lint] Add REUSE.toml for UART wrapper IP
raylau1 4e640d1
[ci] Add license check CI job
raylau1 8e6aeb0
[ci] Add commit metadata check
raylau1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,46 @@ | ||
| # Copyright lowRISC and contributors (COSMIC project). | ||
| # Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: ["main"] | ||
| pull_request: | ||
| branches: ["main"] | ||
| merge_group: | ||
| branches: ["main"] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| lint-check: | ||
| runs-on: ubuntu-26.04 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 # Required so we can lint commit messages and diffs. | ||
|
|
||
| - uses: actions/setup-python@v7 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python3 -m pip install --upgrade pip | ||
| pip3 install . | ||
| rm -r *.egg-info | ||
|
|
||
| - name: License check | ||
| run: reuse lint | ||
|
|
||
| - name: Commit metadata check | ||
| if: ${{ github.event_name == 'pull_request' }} | ||
| run: hw/vendor/lowrisc_ip/ci/scripts/lint-commits.sh "$GITHUB_BASE_REF" |
This file contains hidden or 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 @@ | ||
| ../LICENSE |
This file contains hidden or 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,9 @@ | ||
| # Licenses and Copyright information for top-level files and directories that | ||
| # couldn't otherwise contain it. | ||
|
|
||
| version = 1 | ||
|
|
||
| [[annotations]] | ||
| path = ["*", "doc/**"] | ||
| SPDX-FileCopyrightText = "lowRISC and contributors (COSMIC project)." | ||
| SPDX-License-Identifier = "Apache-2.0" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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,124 @@ | ||
| # Copyright lowRISC and contributors (COSMIC project). | ||
| # Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| { | ||
| description = "UART 16550 Hardware IP Block is part of the COSMIC project."; | ||
| inputs = { | ||
| lowrisc-nix.url = "github:lowRISC/lowrisc-nix"; | ||
|
|
||
| nixpkgs.follows = "lowrisc-nix/nixpkgs"; | ||
| flake-utils.follows = "lowrisc-nix/flake-utils"; | ||
| uv2nix = { | ||
| url = "github:pyproject-nix/uv2nix"; | ||
| inputs.pyproject-nix.follows = "pyproject-nix"; | ||
| inputs.nixpkgs.follows = "nixpkgs"; | ||
| }; | ||
| pyproject-nix = { | ||
| url = "github:pyproject-nix/pyproject.nix"; | ||
| inputs.nixpkgs.follows = "nixpkgs"; | ||
| }; | ||
| pyproject-build-systems = { | ||
| url = "github:pyproject-nix/build-system-pkgs"; | ||
| inputs.nixpkgs.follows = "nixpkgs"; | ||
| inputs.pyproject-nix.follows = "pyproject-nix"; | ||
| inputs.uv2nix.follows = "uv2nix"; | ||
| }; | ||
| }; | ||
|
|
||
| nixConfig = { | ||
| extra-substituters = ["https://nix-cache.lowrisc.org/public/"]; | ||
| extra-trusted-public-keys = ["nix-cache.lowrisc.org-public-1:O6JLD0yXzaJDPiQW1meVu32JIDViuaPtGDfjlOopU7o="]; | ||
| }; | ||
|
|
||
| outputs = { | ||
| nixpkgs, | ||
| flake-utils, | ||
| lowrisc-nix, | ||
| ... | ||
| } @ inputs: let | ||
| system_outputs = system: let | ||
| pkgs = import nixpkgs {inherit system;}; | ||
| lrPkgs = lowrisc-nix.outputs.packages.${system}; | ||
|
|
||
| workspace = inputs.uv2nix.lib.workspace.loadWorkspace {workspaceRoot = ./.;}; | ||
| overlay = workspace.mkPyprojectOverlay { | ||
| sourcePreference = "wheel"; | ||
| }; | ||
|
|
||
| pythonSet = | ||
| (pkgs.callPackage inputs.pyproject-nix.build.packages { | ||
| python = pkgs.python312; | ||
| }).overrideScope | ||
| ( | ||
| pkgs.lib.composeManyExtensions [ | ||
| inputs.pyproject-build-systems.overlays.default | ||
| overlay | ||
| (lowrisc-nix.lib.pyprojectOverrides {inherit pkgs;}) | ||
| ] | ||
| ); | ||
|
|
||
| pythonEnv = pythonSet.mkVirtualEnv "python-env" workspace.deps.default; | ||
| in rec { | ||
| formatter = pkgs.alejandra; | ||
| devShells = rec { | ||
| default = dev; | ||
| # Development shell, built on lowrisc-nix's generic mkEdaShell. Commercial | ||
| # EDA tools (Xcelium, Jasper, Vivado) are declared via tool_data.json and | ||
| # resolved at runtime from the JSON file named by $LOWRISC_EDA_CONFIG. | ||
| # This execs a hermetic FHS sandbox and is not direnv-loadable. | ||
| dev = lowrisc-nix.lib.mkEdaShell { | ||
| inherit pkgs; | ||
| name = "dev"; | ||
| tools = builtins.fromJSON (builtins.readFile ./tool_data.json); | ||
| extraDeps = | ||
| (with pkgs; [ | ||
| bison | ||
| flex | ||
| gtkwave | ||
| uv | ||
| pythonEnv | ||
| autoconf | ||
| pkg-config | ||
| zlib | ||
| zlib.dev | ||
| ]) | ||
| ++ (with lrPkgs; [ | ||
| verilator_5_054 | ||
| ]); | ||
| # Project env, appended after the EDA setup (mkEdaShell has no `env` | ||
| # attr — buildFHSEnv takes a bash profile fragment instead). | ||
| profile = '' | ||
| # Prevent uv from managing Python downloads; force the nixpkgs interpreter. | ||
| export UV_PYTHON_DOWNLOADS=never | ||
| export UV_PYTHON=${pythonSet.python.interpreter} | ||
| ''; | ||
| }; | ||
| # Minimal CI shell without verilator to speed up build time | ||
| ci = lowrisc-nix.lib.mkEdaShell { | ||
| inherit pkgs; | ||
| name = "ci"; | ||
| tools = builtins.fromJSON (builtins.readFile ./tool_data.json); | ||
| extraDeps = | ||
| (with pkgs; [ | ||
| uv | ||
| pythonEnv | ||
| ]); | ||
| # Project env, appended after the EDA setup (mkEdaShell has no `env` | ||
| # attr — buildFHSEnv takes a bash profile fragment instead). | ||
| profile = '' | ||
| # Prevent uv from managing Python downloads; force the nixpkgs interpreter. | ||
| export UV_PYTHON_DOWNLOADS=never | ||
| export UV_PYTHON=${pythonSet.python.interpreter} | ||
| ''; | ||
| }; | ||
| }; | ||
|
|
||
| apps = { | ||
| # Non-interactive entry point into development shells | ||
| dev = devShells.dev.app; | ||
| ci = devShells.ci.app; | ||
| }; | ||
| }; | ||
| in | ||
| flake-utils.lib.eachDefaultSystem system_outputs; | ||
| } |
This file contains hidden or 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,8 @@ | ||
| # Licenses and Copyright for IPs | ||
|
|
||
| version = 1 | ||
|
|
||
| [[annotations]] | ||
| path = ["uart16550/**"] | ||
| SPDX-License-Identifier = "Apache-2.0" | ||
| SPDX-FileCopyrightText = ["lowRISC and contributors (COSMIC project)."] |
This file contains hidden or 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,13 @@ | ||
| # Licenses and Copyright for Vendored Projects | ||
|
|
||
| version = 1 | ||
|
|
||
| [[annotations]] | ||
| path = ["lowrisc_ip/**"] | ||
| SPDX-License-Identifier = "Apache-2.0" | ||
| SPDX-FileCopyrightText = ["lowRISC contributors (OpenTitan project)."] | ||
|
|
||
| [[annotations]] | ||
| path = ["patches/**"] | ||
| SPDX-License-Identifier = "Apache-2.0" | ||
| SPDX-FileCopyrightText = ["lowRISC and contributors (COSMIC project)."] |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.