Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,27 @@ name: test
on:
push:
branches:
- master
- main
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
- uses: actions/checkout@v5
- uses: cachix/install-nix-action@v31
with:
otp-version: "27.1.2"
gleam-version: "1.12.0"
rebar3-version: "3"
# elixir-version: "1"
- run: gleam deps download
- run: gleam test
- run: gleam format --check src test
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: download gleam dependencies
shell: 'nix develop -c bash -e {0}'
run: gleam deps download
- name: gleam test on erlang target
shell: 'nix develop -c bash -e {0}'
run: gleam test
- name: gleam test on nodejs target
shell: 'nix develop -c bash -e {0}'
run: gleam test -t javascript
- name: gleam check formatting
shell: 'nix develop -c bash -e {0}'
run: gleam format --check src test
27 changes: 27 additions & 0 deletions flake.lock

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

26 changes: 26 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
description = "casper";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};

outputs =
{ nixpkgs, ... }:
let
supportedSystems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];

forAllSystems =
function: nixpkgs.lib.genAttrs supportedSystems (system: function nixpkgs.legacyPackages.${system});
in
{
devShells = forAllSystems (pkgs: {
default = pkgs.callPackage ./shell.nix { };
});
};
}
12 changes: 12 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{ pkgs, ... }:
pkgs.mkShell {
buildInputs = with pkgs; [
gleam
rebar3
erlang

nodePackages.nodejs

nixfmt-rfc-style
];
}