Skip to content

Commit

Permalink
version 1.0 \o/
Browse files Browse the repository at this point in the history
  • Loading branch information
matsumonkie committed Feb 10, 2021
1 parent 0a69f10 commit 2745bc4
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 15 deletions.
60 changes: 45 additions & 15 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,71 @@
# izuna-action

This action create a tar archive of your hie files and send it to izuna server so they can be processed.
Note that it does not generate your hie files. You need to do that yourself by modifying your stack file:
## How to install

### Install the chrome extension

Go to the [chrome webstore](https://chrome.google.com/webstore/detail/izuna/fdddagbfkgicjkeijmbfdcmjeldegfdi) and install the chrome extension.

### Add Github Action to your project

To install izuna, you need to have github action enabled for your project. This simply means having a `.github/workflows/main.yml` file in your project. See documentation for [Github action with Haskell](https://github.com/haskell/actions/tree/main/setup)


### Generate Hie

Once you have your project ready to build with Github action, you need to add the hie generation option to your build process.
This can be done in multiple ways:

1. modify your stack file:

```yaml
ghc-options:
- -fwrite-ide-info
- -hiedir=.hie
```
Or your cabal file:
2. modify your cabal file:
```cabal
ghc-options: -fwrite-ide-info -hiedir=.hie
```
## Usage
3. modify the build command:
If you don't feel like modifying your stack or cabal file, you can simply add add an instruction in your `main.yml` file to rebuild with hie enabled:

```yaml
- name: Build your project with hie files generation
run: |
stack build --ghc-options="-fwrite-ide-info -hiedir=.hie" --force-dirty
```
`--force-dirty` is only mandatory if you have already instruct github to build your project in the `main.yml` file. It will force a recompilation of you're project and make sure the hie files are hence correctly generated.

### Run izuna-action

Finally, you need to add izuna-action to your `main.yml` file.

izuna-action creates a tar archive of your hie files and sends it to izuna server so they can be further processed (then deleted, we do not keep the hie files).

a simple usage is:
This is done like this:
```yaml
- name: build project info for izuna
uses: matsumonkie/izuna-action@v0.43
- name: izuna for izuna-builder
uses: matsumonkie/izuna-action@v1.0
with:
owner: 'matsumonkie'
repository: 'izuna-example'
package: 'izuna-example'
ghcVersion: '8.10.1'
hieDirectory: '.hie/'
hieDirectory: 'izuna-builder/.hie/'
projectRoot: 'izuna-builder/'
```

`hieDirectory` is the path where the hie files will be store in your project (e.g: usually `".hie/"`)
`projectRoot` is the path where your src/ folder lies (usually: `"./"`)
Note that all parameters are required and cannot be empty.
Note that ghcVersion can only be 8.10.1 for now. 8.10.2 will be available soon.
Note that `ghcVersion` can only be `8.10.1` or `8.10.2` at the moment. More recent versions will be available soon.

## Example usage
## Full example usage

[izuna-example](https://github.com/matsumonkie/izuna-example/) is using this github-action. You might want to check the [main.yaml](https://github.com/matsumonkie/izuna-example/blob/main/.github/workflows/main.yml#L39-L46) file for a complete usage!
The Izuna project is using izuna-action and can be read [here](https://github.com/matsumonkie/izuna-example/blob/main/.github/workflows/main.yml#L44-L49) for a complete usage!

## Build the action
## Dev

run: `npm run all`
Binary file modified node_modules/@vercel/ncc/dist/ncc/cli.js.cache
Binary file not shown.
Binary file modified node_modules/@vercel/ncc/dist/ncc/index.js.cache
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 2745bc4

Please sign in to comment.