diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..a150672 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,5 @@ +{ + "arrowParens": "avoid", + "printWidth": 100, + "trailingComma": "all" +} \ No newline at end of file diff --git a/README.md b/README.md index 4085dd6..79b9f14 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,36 @@ The binaries will be added to the relevant environment variables for the platfor Released under the Apache License 2.0. +## Example Usage + +```yml +- name: Install LLVM and Clang + uses: KyleMayes/install-llvm-action@v1 + with: + version: "10.0" +``` + +## Example Usage (with non-default installation directory): + +```yml +- name: Install LLVM and Clang + uses: KyleMayes/install-llvm-action@v1 + with: + version: "10.0" + directory: ${{ runner.temp }}/llvm +``` + +## Linking to Installed Libraries (Linux) + +If your build system requires a library from the installed LLVM and Clang binaries such as `libclang.so`, and it fails to find it, then it may help to create a symlink for the versioned `.so` using the following step which utilizes the `LLVM_PATH` environment variable set by this action: + +```yaml +- name: Symlink libclang.so (Linux) + if: contains(matrix.os, 'ubuntu') + run: sudo ln -s libclang-11.so.1 /lib/x86_64-linux-gnu/libclang.so + working-directory: ${{ env.LLVM_PATH }}/lib +``` + ## Inputs ### `version` @@ -67,33 +97,3 @@ Whether to set `CC` and `CXX` environment variables to Clang paths. The full version of LLVM and Clang binaries installed. This will only differ from the value of the `version` option when specifying a minimum version like `3.6` or `3`. - -## Example Usage - -```yml -- name: Install LLVM and Clang - uses: KyleMayes/install-llvm-action@v1 - with: - version: "10.0" -``` - -## Example Usage (with non-default installation directory): - -```yml -- name: Install LLVM and Clang - uses: KyleMayes/install-llvm-action@v1 - with: - version: "10.0" - directory: ${{ runner.temp }}/llvm -``` - -## Linking to Installed Libraries (Linux) - -If your build system requires a library from the installed LLVM and Clang binaries such as `libclang.so`, and it fails to find it, then it may help to create a symlink for the versioned `.so` using the following step which utilizes the `LLVM_PATH` environment variable set by this action: - -```yaml -- name: Symlink libclang.so (Linux) - if: contains(matrix.os, 'ubuntu') - run: sudo ln -s libclang-11.so.1 /lib/x86_64-linux-gnu/libclang.so - working-directory: ${{ env.LLVM_PATH }}/lib -``` diff --git a/package.json b/package.json index 902c99f..2c36053 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "license": "Apache-2.0", "main": "dist/index.js", "scripts": { + "format": "prettier --write src/*.ts", "build": "parcel build index.ts", "test": "ts-node test.ts test" },