amitaibu / ihp-cms-starter

5 stars 2 forks source link

Add GH action for testing #20

Closed amitaibu closed 1 year ago

amitaibu commented 1 year ago

I saw the installation of node takes a long time. I'm experiencing similar behavior on my laptop (I think it was faster on my desktop computer, but it might have been long time ago and I just don't remember).

By removing node, build time was much faster. It's now erroring here, which is probably outdated. I'll try to use devenv up

amitaibu commented 1 year ago
  1. Build takes 30min, but we should add cachix, and I believe it would speed it up once it's cached.

  2. For this repo we need to add RSA keys (see error)

ssh-keygen -t rsa -b 4096 -m PEM -f ./Config/jwtRS256.key && openssl rsa -in ./Config/jwtRS256.key -pubout -outform PEM -out ./Config/jwtRS256.key.pub

  1. Find a way to see If devenv up errors, and exit test
mpscholten commented 1 year ago

@amitaibu the nodejs issue was also reported to me by @s0kil. It seems something is off with our current nixpkgs revision that causes nodejs to be not in the standard binary cache

amitaibu commented 1 year ago

nix-shell --run "runghc $(make print-ghc-extensions) -i. -ibuild -iConfig Test/Main.hs" seems to invoke all the tests of all the packages, Not just the custom ones. See example

image

amitaibu commented 1 year ago

I think my above assumption is wrong, and that those packages tests are running as part of the build process. It's running even when I've commented out nix-shell --run "runghc $(make print-ghc-extensions) -i. -ibuild -iConfig Test/Main.hs"

image

mpscholten commented 1 year ago

Yes this is caused by nix building a lot of stuff. It seems you've swapped out the binary cache in your github action. To speed up the build it would be helpful to add the digitallyinduced binary cache as well (using skipPush: true):

      - name: Cachix Init
        uses: cachix/cachix-action@v12
        with:
          name: digitallyinduced
          skipPush: true

You can have multiple cachix-actions in a single github action, so you can still keep your own cachix cache there as well

amitaibu commented 1 year ago

It seems you've swapped out the binary cache in your github action

Yeah, just playing around with it. Is there a reason for me to indeed do that, or safe to stay with DI's cachix?

amitaibu commented 1 year ago

Oh yeah, the last commit ran for 4m, and executed the tests! :balloon:

image

mpscholten commented 1 year ago

Great!

amitaibu commented 1 year ago

It seems something is off with our current nixpkgs revision that causes nodejs to be not in the standard binary cache

We still need to figure this one.