Skip to content

Commit

Permalink
Merge branch 'main' into gabriela/readme-update
Browse files Browse the repository at this point in the history
  • Loading branch information
bugarela authored Jul 26, 2024
2 parents 9e5e94e + 480b365 commit 75063bf
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 23 deletions.
35 changes: 23 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,22 +191,33 @@ jobs:
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, macos-latest, windows-latest]
operating-system: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- name: Cache nix store
# Workaround for cache action not playing well with permissions
# See https://github.com/actions/cache/issues/324
uses: john-shaffer/cache@59429c0461095f341a8cf7388e5d3aef37b95edd
with:
node-version: "20"
path: |
/nix/store
/nix/var/nix/profiles
key: ${{ runner.os }}-nix-${{ hashFiles('**.nix') }}
restore-keys: |
${{ runner.os }}-nix-
${{ runner.os }}-
- name: Install Nix
uses: cachix/install-nix-action@v22
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Build dev-shell
run: nix develop -c bash -c exit
- name: Install quint deps
run: cd ./quint && npm install
- name: Install yalc
run: npm i yalc -g
run: cd ./quint && nix develop -c npm install
- name: Compile quint vscode plugin
run: make local
run: nix develop -c make local
- name: Run vscode unit tests
run: cd ./vscode/quint-vscode && npm test
run: cd ./vscode/quint-vscode && nix develop -c npm test
- name: Check that we can create the vsix package
run: |
cd ./vscode/quint-vscode
npm install --global @vscode/vsce
vsce package
run: cd ./vscode/quint-vscode && nix develop -c vsce package
29 changes: 29 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,35 @@ Currently, the project consists of two npm packages:
For setting up the local build, you would have to install TypeScript and npm.
This is usually done via your local package manager.

### Nix for development dependencies

We provide a nix shell in case you want to use nix to manage your development
environment and dependencies.

Make sure you have `nix` installed, then build and enter the clean development shell with:

```sh
$ nix develop
```

If you want to use direnv to setup your environment with nix (instead of using a
shell), you will need to add `use flake;` to your `.envrc`, and then
running `direnv allow`:

```sh
$ echo "use flake;" >> .envrc && direnv allow
```

You can also add a `direnv` extension/package to your IDE of choice to have
those dependencies set up for the IDE to use.

#### Updating nix dependencies

To update one of the flake inputs you can run: `nix flake lock --update-input <input-name>`

To update all of the inputes you can run: `nix flake update`, it is recommended
to update dependencies one by one though.

### Formatting

We use [eslint][] to enforce the good coding practices of JavaScript and
Expand Down
60 changes: 60 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
description = "An executable specification language";

inputs = { nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; };

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in {
devShell = pkgs.mkShell {
buildInputs = [
pkgs.nodejs_18
pkgs.jre # for antlr4ts
pkgs.nodePackages.yalc
pkgs.vsce
pkgs.parallel
];

shellHook = "npm config set prefix ~/.npm";
};
});
}
11 changes: 0 additions & 11 deletions quint/default.nix

This file was deleted.

0 comments on commit 75063bf

Please sign in to comment.