Skip to content

Commit be5295a

Browse files
authored
Merge pull request #197 from cachix/dev-restructure
2 parents 772616c + dbbedb8 commit be5295a

18 files changed

+918
-3085
lines changed

.github/workflows/build.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: "Build"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: cachix/install-nix-action@v30
15+
- run: nix profile install nixpkgs#devenv
16+
- name: Build
17+
run: devenv shell -- pnpm build
18+
# Check that build was committed
19+
- name: Verify latest build
20+
run: git diff --exit-code
21+
22+
test:
23+
needs: [build]
24+
uses: ./.github/workflows/test.yml
25+
secrets: inherit

.github/workflows/test.yml

+3-21
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
name: "cachix-action test"
2-
on:
3-
pull_request:
4-
push:
5-
branches:
6-
- master
1+
name: "Test"
2+
3+
on: workflow_call
74

85
env:
96
ACTIONS_STEP_DEBUG: true
@@ -17,10 +14,6 @@ jobs:
1714
runs-on: ${{ matrix.os }}
1815
steps:
1916
- uses: actions/checkout@v4
20-
- run: yarn install --frozen-lockfile
21-
- run: yarn build
22-
# check if typescript generation was committed
23-
- run: git diff --exit-code
2417
- uses: cachix/install-nix-action@v30
2518
- name: Test public cache
2619
uses: ./
@@ -38,8 +31,6 @@ jobs:
3831
runs-on: ${{ matrix.os }}
3932
steps:
4033
- uses: actions/checkout@v4
41-
- run: yarn install --frozen-lockfile
42-
- run: yarn build
4334
- uses: cachix/install-nix-action@v30
4435
- name: Test public cache no signing key
4536
uses: ./
@@ -57,8 +48,6 @@ jobs:
5748
runs-on: ${{ matrix.os }}
5849
steps:
5950
- uses: actions/checkout@v4
60-
- run: yarn install --frozen-lockfile
61-
- run: yarn build
6251
- uses: cachix/install-nix-action@v30
6352
- name: Test private cache
6453
uses: ./
@@ -76,8 +65,6 @@ jobs:
7665
runs-on: ${{ matrix.os }}
7766
steps:
7867
- uses: actions/checkout@v4
79-
- run: yarn install --frozen-lockfile
80-
- run: yarn build
8168
- uses: cachix/install-nix-action@v30
8269
- id: paths
8370
run: |
@@ -97,8 +84,6 @@ jobs:
9784
runs-on: ${{ matrix.os }}
9885
steps:
9986
- uses: actions/checkout@v4
100-
- run: yarn install --frozen-lockfile
101-
- run: yarn build
10287
- uses: cachix/install-nix-action@v30
10388
- name: Test private cache
10489
uses: ./
@@ -133,9 +118,6 @@ jobs:
133118
install_url: https://hydra.nixos.org/job/nix/master/installerScript/latest-finished/download/1/install
134119
install_options: "--tarball-url-prefix http://localhost:8080"
135120

136-
- run: yarn install --frozen-lockfile
137-
- run: yarn build
138-
139121
- name: Test public cache
140122
uses: ./
141123
with:

README.md

+2-8
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,11 @@ Note that malicious code submitted via forked pull request can, once merged into
3838
Install the dependencies
3939

4040
```bash
41-
$ yarn install
41+
$ pnpm install
4242
```
4343

4444
Build the typescript
4545

4646
```bash
47-
$ yarn build
48-
```
49-
50-
Run the tests :heavy_check_mark:
51-
52-
```bash
53-
$ yarn test
47+
$ pnpm build
5448
```

action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ branding:
3535
icon: "database"
3636
runs:
3737
using: "node20"
38-
main: "dist/main/index.js"
39-
post: "dist/main/index.js"
38+
main: "dist/index.js"
39+
post: "dist/index.js"

devenv.lock

+9-25
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"devenv": {
44
"locked": {
55
"dir": "src/modules",
6-
"lastModified": 1731679695,
6+
"lastModified": 1735883199,
77
"owner": "cachix",
88
"repo": "devenv",
9-
"rev": "9f6cadacb9db82f541bbadd67e0189a2b850937e",
9+
"rev": "d67d04ae2dd3bc3723e615003034ba752e8db8c3",
1010
"type": "github"
1111
},
1212
"original": {
@@ -19,10 +19,10 @@
1919
"flake-compat": {
2020
"flake": false,
2121
"locked": {
22-
"lastModified": 1696426674,
22+
"lastModified": 1733328505,
2323
"owner": "edolstra",
2424
"repo": "flake-compat",
25-
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
25+
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
2626
"type": "github"
2727
},
2828
"original": {
@@ -53,10 +53,10 @@
5353
},
5454
"nixpkgs": {
5555
"locked": {
56-
"lastModified": 1731531548,
56+
"lastModified": 1735685343,
5757
"owner": "NixOS",
5858
"repo": "nixpkgs",
59-
"rev": "24f0d4acd634792badd6470134c387a3b039dace",
59+
"rev": "81934660d6e9ea54d2f0cdee821e8533b10c221a",
6060
"type": "github"
6161
},
6262
"original": {
@@ -66,35 +66,19 @@
6666
"type": "github"
6767
}
6868
},
69-
"nixpkgs-stable": {
70-
"locked": {
71-
"lastModified": 1731386116,
72-
"owner": "NixOS",
73-
"repo": "nixpkgs",
74-
"rev": "689fed12a013f56d4c4d3f612489634267d86529",
75-
"type": "github"
76-
},
77-
"original": {
78-
"owner": "NixOS",
79-
"ref": "nixos-24.05",
80-
"repo": "nixpkgs",
81-
"type": "github"
82-
}
83-
},
8469
"pre-commit-hooks": {
8570
"inputs": {
8671
"flake-compat": "flake-compat",
8772
"gitignore": "gitignore",
8873
"nixpkgs": [
8974
"nixpkgs"
90-
],
91-
"nixpkgs-stable": "nixpkgs-stable"
75+
]
9276
},
9377
"locked": {
94-
"lastModified": 1731363552,
78+
"lastModified": 1735882644,
9579
"owner": "cachix",
9680
"repo": "pre-commit-hooks.nix",
97-
"rev": "cd1af27aa85026ac759d5d3fccf650abe7e1bbf0",
81+
"rev": "a5a961387e75ae44cc20f0a57ae463da5e959656",
9882
"type": "github"
9983
},
10084
"original": {

devenv.nix

+8-12
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,31 @@ let
44
nodejs = pkgs.nodejs_20;
55
in
66
{
7-
packages =
8-
let
9-
nodePackages = config.languages.javascript.package.pkgs;
10-
in
11-
[
12-
pkgs.act
13-
nodePackages.typescript-language-server
14-
];
7+
packages = [
8+
pkgs.act
9+
nodejs.pkgs.typescript-language-server
10+
];
1511

1612
languages.typescript.enable = true;
1713

1814
languages.javascript = {
1915
enable = true;
2016
package = nodejs;
21-
yarn.enable = true;
22-
yarn.install.enable = true;
17+
pnpm.enable = true;
18+
pnpm.install.enable = true;
2319
};
2420

2521
git-hooks.hooks = {
2622
prettier = {
2723
enable = true;
28-
excludes = [ "dist" ];
24+
files = "src/.*$";
2925
};
3026
nixfmt-rfc-style.enable = true;
3127
build-dist = {
3228
enable = true;
3329
files = "src/.*$";
3430
pass_filenames = false;
35-
entry = "devenv shell yarn build";
31+
entry = "devenv shell -- pnpm build";
3632
};
3733
};
3834
}

0 commit comments

Comments
 (0)