Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: CI using custom GH Actions #22

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

WIP: CI using custom GH Actions #22

wants to merge 1 commit into from

Conversation

AronNovak
Copy link
Collaborator

No description provided.

@AronNovak
Copy link
Collaborator Author

@amitaibu

which: no RunDevServer in (/root/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin)
Makefile:27: *** IHP not found!.  Stop.
File devenv.nix does not exist. To get started, run:

  $ devenv init
warning: $HOME ('/github/home') is not owned by you, falling back to the one defined in the 'passwd' file ('/root')

<no location info>: error: Can't find Test/Main.hs
*** Exception: ExitFailure 1

Do you think we need a devenv.nix in the repository root?

@amitaibu
Copy link
Owner

Do you think we need a devenv.nix in the repository root?

No, it indicates that direnv allow was not executed

@amitaibu
Copy link
Owner

@AronNovak you are also missing this part https://github.com/digitallyinduced/ihp-boilerplate/pull/28/files#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88R25-R30

btw, can an action user other actions? So this whole section could have be replaced.

@AronNovak
Copy link
Collaborator Author

AronNovak commented Jun 29, 2023

@amitaibu

So

    # Use the cachix cache for faster builds.
    - name: Cachix Init
      uses: cachix/cachix-action@v12
      with:
        name: digitallyinduced
        skipPush: true

is at:

# Update the package repository sources and install necessary tools
RUN nix-channel --update && \
    nix-env -iA nixpkgs.git nixpkgs.cachix

and

# Use Cachix
RUN cachix use digitallyinduced && \
    cachix use devenv

not?

btw, can an action user other actions?

No, a Docker-based Action is one single Docker build process. What I can do is to rely on a base image, what I did, to rely on FROM nixos/nix:latest, not on an Ubuntu base image, to save time.

We might decide to upload the whole Docker image to Dockerhub, so no need to wait at GH action for the Docker image building.

@AronNovak
Copy link
Collaborator Author

No, it indicates that direnv allow was not executed

Then likely I need to move it from the Dockerfile to the entrypoint, trying it out now.

@AronNovak
Copy link
Collaborator Author

docker run ihp-test --workdir /github/workspace -v "/home/aaron/gizra/ihp-landing-page":"/github/workspace"

I try to speed up the testing process, to avoid to publish a new GH Action every time with a new change, this command can"t simulate yet a GH actions invocation, somehow it does not find /default.nix, maybe workdir is not effective.

@AronNovak
Copy link
Collaborator Author

docker run --workdir /github/workspace -v "/home/aaron/gizra/ihp-landing-page":"/github/workspace" ihp-test

This is the proper command to test-drive locally.

@AronNovak
Copy link
Collaborator Author

I have some progress, but not with ihp-landing-page repo, but the other closed source one, as it lacks tests, if I am not mistaken.

That's where I am now:

Warning: haddock-interfaces: /nix/store/pdxjlgnl95lkl5j7f07gj1bz4pslsnns-attoparsec-0.14.4/share/doc/x86_64-linux-ghc-9.4.4/attoparsec-0.14.4/html/attoparsec.haddock doesn't exist or isn't a file
Warning: haddock-html: /nix/store/pdxjlgnl95lkl5j7f07gj1bz4pslsnns-attoparsec-0.14.4/share/doc/x86_64-linux-ghc-9.4.4/attoparsec-0.14.4/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /nix/store/4v06bsic1s6i08jdhg2l8y3va1gs22x6-data-array-byte-0.1.0.1-doc/share/doc/data-array-byte-0.1.0.1/html/data-array-byte.haddock doesn't exist or isn't a file
Warning: haddock-html: /nix/store/4v06bsic1s6i08jdhg2l8y3va1gs22x6-data-array-byte-0.1.0.1-doc/share/doc/data-array-byte-0.1.0.1/html doesn't exist or isn't a directory
Creating devenv.nix
Done.
direnv is installed. Running direnv allow.
warning: Git tree '/github/workspace' is dirty
which: no RunDevServer in (/root/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin)
Makefile:27: *** IHP not found!.  Stop.
warning: Git tree '/github/workspace' is dirty
Building shell ...

Test/Form.hs:15:29: error: Operator applied to too few arguments: ?

I guess now the key is Makefile:27: *** IHP not found!. Stop.

@AronNovak
Copy link
Collaborator Author

@amitaibu Do you plan to add tests here? Or does this repo already have some basic ones that I missed?

@amitaibu
Copy link
Owner

amitaibu commented Jul 3, 2023

@AronNovak you can copy the test and the package added to flake.nix from https://github.com/amitaibu/ihp-landing-page/pull/20/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants