Skip to content
This repository was archived by the owner on Sep 1, 2025. It is now read-only.

Commit 97ccd84

Browse files
authored
Merge pull request #1107 from rohaquinlop/testLicense
feat(build): #1099 licensing builtin with reuse
2 parents c18b4ab + de36dbf commit 97ccd84

10 files changed

Lines changed: 80 additions & 42 deletions

File tree

.github/workflows/dev.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -194,23 +194,6 @@ jobs:
194194
- name: /helloWorld
195195
run: nix-env -if . && m . /helloWorld
196196

197-
linux_license:
198-
runs-on: ubuntu-latest
199-
steps:
200-
- uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222
201-
- uses: docker://docker.io/nixos/nix@sha256:c3db4c484f6b1ee6c9bb8ca90307cfbeca8ef88156840911356a677eeaff4845
202-
name: /license
203-
with:
204-
set-safe-directory: /github/workspace
205-
args: sh -c "nix-env -if . && m . /license"
206-
macos_license:
207-
runs-on: macos-latest
208-
steps:
209-
- uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222
210-
- uses: cachix/install-nix-action@67e9fd765dbe63fabe0ce2bd72f56f9a417696a0
211-
- name: /license
212-
run: nix-env -if . && m . /license
213-
214197
linux_lintBash:
215198
runs-on: ubuntu-latest
216199
steps:
@@ -490,6 +473,23 @@ jobs:
490473
- name: /taintTerraform/module
491474
run: nix-env -if . && m . /taintTerraform/module
492475

476+
linux_testLicense:
477+
runs-on: ubuntu-latest
478+
steps:
479+
- uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222
480+
- uses: docker://docker.io/nixos/nix@sha256:c3db4c484f6b1ee6c9bb8ca90307cfbeca8ef88156840911356a677eeaff4845
481+
name: /testLicense
482+
with:
483+
set-safe-directory: /github/workspace
484+
args: sh -c "nix-env -if . && m . /testLicense"
485+
macos_testLicense:
486+
runs-on: macos-latest
487+
steps:
488+
- uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222
489+
- uses: cachix/install-nix-action@67e9fd765dbe63fabe0ce2bd72f56f9a417696a0
490+
- name: /testLicense
491+
run: nix-env -if . && m . /testLicense
492+
493493
linux_testPython_cliMain:
494494
runs-on: ubuntu-latest
495495
steps:

.github/workflows/prod.yml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -357,27 +357,6 @@ jobs:
357357
env:
358358
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
359359

360-
linux_license:
361-
runs-on: ubuntu-latest
362-
steps:
363-
- uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222
364-
- uses: docker://docker.io/nixos/nix@sha256:c3db4c484f6b1ee6c9bb8ca90307cfbeca8ef88156840911356a677eeaff4845
365-
name: /license
366-
with:
367-
set-safe-directory: /github/workspace
368-
args: sh -c "nix-env -if . && m . /license"
369-
env:
370-
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
371-
macos_license:
372-
runs-on: macos-latest
373-
steps:
374-
- uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222
375-
- uses: cachix/install-nix-action@67e9fd765dbe63fabe0ce2bd72f56f9a417696a0
376-
- name: /license
377-
run: nix-env -if . && m . /license
378-
env:
379-
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
380-
381360
linux_lintBash:
382361
runs-on: ubuntu-latest
383362
steps:
@@ -721,6 +700,23 @@ jobs:
721700
env:
722701
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
723702

703+
linux_testLicense:
704+
runs-on: ubuntu-latest
705+
steps:
706+
- uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222
707+
- uses: docker://docker.io/nixos/nix@sha256:c3db4c484f6b1ee6c9bb8ca90307cfbeca8ef88156840911356a677eeaff4845
708+
name: /testLicense
709+
with:
710+
set-safe-directory: /github/workspace
711+
args: sh -c "nix-env -if . && m . /testLicense"
712+
macos_testLicense:
713+
runs-on: macos-latest
714+
steps:
715+
- uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222
716+
- uses: cachix/install-nix-action@67e9fd765dbe63fabe0ce2bd72f56f9a417696a0
717+
- name: /testLicense
718+
run: nix-env -if . && m . /testLicense
719+
724720
linux_testPython_example:
725721
runs-on: ubuntu-latest
726722
steps:

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ John Perez <mrjohnjairo10@gmail.com> John Perez <mrjohnjairo10@gmail.com>
1919
Kevin Amado <kamadorueda@gmail.com> Kevin Amado <kamadorueda@gmail.com>
2020
Luis Saavedra <lsaavedra@fluidattacks.com> Luis David Saavedra <40694133+ludsrill@users.noreply.github.com>
2121
Luis Saavedra <lsaavedra@fluidattacks.com> Luis Saavedra <lsaavedra@fluidattacks.com>
22+
Robin Hafid <rohaquinlop301@gmail.com> Robin Hafid <rohaquinlop301@gmail.com>
2223
Robin Quintero <rohaquinlop301@gmail.com> Robin Quintero <rohaquinlop301@gmail.com>
2324
Timothy DeHerrera <tim.deherrera@iohk.io> Timothy DeHerrera <tim.deherrera@iohk.io>

docs/src/api/builtins/test.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
## testLicense
2+
3+
Test the license of a project using [reuse](https://reuse.software/).
4+
5+
Types:
6+
7+
- testLicense: Empty attribute set.
8+
9+
Example:
10+
11+
=== "makes.nix"
12+
13+
```nix
14+
{
15+
testLicense = {};
16+
}
17+
```
18+
19+
=== "Invocation"
20+
21+
```bash
22+
m . /testLicense
23+
```
24+
125
## testPullRequest
226

327
Test a pull request

makes.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@
252252
};
253253
};
254254
};
255+
testLicense = {};
255256
testPython = {
256257
example = {
257258
python = "3.11";

src/args/agnostic.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
stringCapitalize = import ./string-capitalize/default.nix self;
108108
sublist = import ./sublist/default.nix self;
109109
taintTerraform = import ./taint-terraform/default.nix self;
110+
testLicense = import ./test-license/default.nix self;
110111
testTerraform = import ./test-terraform/default.nix self;
111112
testPullRequest = import ./test-pull-request/default.nix self;
112113
testPython = import ./test-python/default.nix self;
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
inputs,
2+
__nixpkgs__,
33
makeScript,
44
...
55
}:
66
makeScript {
7+
name = "test-license";
78
entrypoint = ./entrypoint.sh;
8-
name = "license";
99
searchPaths.bin = [
10-
inputs.nixpkgs.git
11-
inputs.nixpkgs.reuse
10+
__nixpkgs__.git
11+
__nixpkgs__.reuse
1212
];
1313
}

src/evaluator/modules/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
(import ./secure-kubernetes-with-rbac-police/default.nix args)
5151
(import ./secure-python-with-bandit/default.nix args)
5252
(import ./taint-terraform/default.nix args)
53+
(import ./test-license/default.nix args)
5354
(import ./test-pull-request/default.nix args)
5455
(import ./test-python/default.nix args)
5556
(import ./test-terraform/default.nix args)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{testLicense, ...}: {
2+
config,
3+
lib,
4+
...
5+
}: {
6+
options = {
7+
testLicense = {};
8+
};
9+
config = {
10+
outputs = {
11+
"/testLicense" = testLicense;
12+
};
13+
};
14+
}

0 commit comments

Comments
 (0)