diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5dec516..4026020 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..0360468 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1718835956, + "narHash": "sha256-wM9v2yIxClRYsGHut5vHICZTK7xdrUGfrLkXvSuv6s4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "dd457de7e08c6d06789b1f5b88fc9327f4d96309", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..fc0f7d1 --- /dev/null +++ b/flake.nix @@ -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 + ]; + }; + }); + }; +}