Skip to content

Commit

Permalink
Merge pull request #45 from akash-akya/nix
Browse files Browse the repository at this point in the history
Switch to nix based github action for macos
  • Loading branch information
akash-akya authored Jun 23, 2024
2 parents 82729d1 + 5b3a29e commit cea756c
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 9 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,16 @@ jobs:
- run: mix compile --warnings-as-errors
- run: mix test --exclude skip:true --trace

macos-test:
macos:
runs-on: macos-11
name: Test - Elixir (MacOS)
steps:
- uses: actions/checkout@v3
- name: Install erlang and elixir
run: |
brew install erlang elixir
mix local.hex --force
mix local.rebar --force
- run: mix deps.get
- run: mix test --trace
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: DeterminateSystems/flake-checker-action@main
- run: nix develop --command mix deps.get
- run: nix develop --command mix test --trace

lint:
runs-on: ubuntu-22.04
Expand Down
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.

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

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

outputs = { self, nixpkgs, ... }:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit system; };
});
in
{
devShells = forAllSystems ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [
elixir
];
};
});
};
}

0 comments on commit cea756c

Please sign in to comment.