Skip to content

Commit

Permalink
Merge pull request #197 from cachix/dev-restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
sandydoo authored Jan 3, 2025
2 parents 772616c + dbbedb8 commit be5295a
Show file tree
Hide file tree
Showing 18 changed files with 918 additions and 3,085 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Build"

on:
pull_request:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- run: nix profile install nixpkgs#devenv
- name: Build
run: devenv shell -- pnpm build
# Check that build was committed
- name: Verify latest build
run: git diff --exit-code

test:
needs: [build]
uses: ./.github/workflows/test.yml
secrets: inherit
24 changes: 3 additions & 21 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: "cachix-action test"
on:
pull_request:
push:
branches:
- master
name: "Test"

on: workflow_call

env:
ACTIONS_STEP_DEBUG: true
Expand All @@ -17,10 +14,6 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: yarn install --frozen-lockfile
- run: yarn build
# check if typescript generation was committed
- run: git diff --exit-code
- uses: cachix/install-nix-action@v30
- name: Test public cache
uses: ./
Expand All @@ -38,8 +31,6 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: yarn install --frozen-lockfile
- run: yarn build
- uses: cachix/install-nix-action@v30
- name: Test public cache no signing key
uses: ./
Expand All @@ -57,8 +48,6 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: yarn install --frozen-lockfile
- run: yarn build
- uses: cachix/install-nix-action@v30
- name: Test private cache
uses: ./
Expand All @@ -76,8 +65,6 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: yarn install --frozen-lockfile
- run: yarn build
- uses: cachix/install-nix-action@v30
- id: paths
run: |
Expand All @@ -97,8 +84,6 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: yarn install --frozen-lockfile
- run: yarn build
- uses: cachix/install-nix-action@v30
- name: Test private cache
uses: ./
Expand Down Expand Up @@ -133,9 +118,6 @@ jobs:
install_url: https://hydra.nixos.org/job/nix/master/installerScript/latest-finished/download/1/install
install_options: "--tarball-url-prefix http://localhost:8080"

- run: yarn install --frozen-lockfile
- run: yarn build

- name: Test public cache
uses: ./
with:
Expand Down
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,11 @@ Note that malicious code submitted via forked pull request can, once merged into
Install the dependencies

```bash
$ yarn install
$ pnpm install
```

Build the typescript

```bash
$ yarn build
```

Run the tests :heavy_check_mark:

```bash
$ yarn test
$ pnpm build
```
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ branding:
icon: "database"
runs:
using: "node20"
main: "dist/main/index.js"
post: "dist/main/index.js"
main: "dist/index.js"
post: "dist/index.js"
34 changes: 9 additions & 25 deletions devenv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1731679695,
"lastModified": 1735883199,
"owner": "cachix",
"repo": "devenv",
"rev": "9f6cadacb9db82f541bbadd67e0189a2b850937e",
"rev": "d67d04ae2dd3bc3723e615003034ba752e8db8c3",
"type": "github"
},
"original": {
Expand All @@ -19,10 +19,10 @@
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"lastModified": 1733328505,
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"type": "github"
},
"original": {
Expand Down Expand Up @@ -53,10 +53,10 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1731531548,
"lastModified": 1735685343,
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "24f0d4acd634792badd6470134c387a3b039dace",
"rev": "81934660d6e9ea54d2f0cdee821e8533b10c221a",
"type": "github"
},
"original": {
Expand All @@ -66,35 +66,19 @@
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1731386116,
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "689fed12a013f56d4c4d3f612489634267d86529",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
]
},
"locked": {
"lastModified": 1731363552,
"lastModified": 1735882644,
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "cd1af27aa85026ac759d5d3fccf650abe7e1bbf0",
"rev": "a5a961387e75ae44cc20f0a57ae463da5e959656",
"type": "github"
},
"original": {
Expand Down
20 changes: 8 additions & 12 deletions devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,31 @@ let
nodejs = pkgs.nodejs_20;
in
{
packages =
let
nodePackages = config.languages.javascript.package.pkgs;
in
[
pkgs.act
nodePackages.typescript-language-server
];
packages = [
pkgs.act
nodejs.pkgs.typescript-language-server
];

languages.typescript.enable = true;

languages.javascript = {
enable = true;
package = nodejs;
yarn.enable = true;
yarn.install.enable = true;
pnpm.enable = true;
pnpm.install.enable = true;
};

git-hooks.hooks = {
prettier = {
enable = true;
excludes = [ "dist" ];
files = "src/.*$";
};
nixfmt-rfc-style.enable = true;
build-dist = {
enable = true;
files = "src/.*$";
pass_filenames = false;
entry = "devenv shell yarn build";
entry = "devenv shell -- pnpm build";
};
};
}
Loading

0 comments on commit be5295a

Please sign in to comment.