Use Prettier for Markdown
As Prettier infers the parser from the input file path, the `parser` option can be safely removed.
This commit is contained in:
parent
9ceee97d99
commit
04a5d36eb6
|
@ -7,5 +7,12 @@
|
||||||
"trailingComma": "none",
|
"trailingComma": "none",
|
||||||
"bracketSpacing": true,
|
"bracketSpacing": true,
|
||||||
"arrowParens": "avoid",
|
"arrowParens": "avoid",
|
||||||
"parser": "typescript"
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": "**/*.md",
|
||||||
|
"options": {
|
||||||
|
"tabWidth": 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
|
@ -14,21 +14,21 @@ appearance, race, religion, or sexual identity and orientation.
|
||||||
Examples of behavior that contributes to creating a positive environment
|
Examples of behavior that contributes to creating a positive environment
|
||||||
include:
|
include:
|
||||||
|
|
||||||
* Using welcoming and inclusive language
|
- Using welcoming and inclusive language
|
||||||
* Being respectful of differing viewpoints and experiences
|
- Being respectful of differing viewpoints and experiences
|
||||||
* Gracefully accepting constructive criticism
|
- Gracefully accepting constructive criticism
|
||||||
* Focusing on what is best for the community
|
- Focusing on what is best for the community
|
||||||
* Showing empathy towards other community members
|
- Showing empathy towards other community members
|
||||||
|
|
||||||
Examples of unacceptable behavior by participants include:
|
Examples of unacceptable behavior by participants include:
|
||||||
|
|
||||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
- The use of sexualized language or imagery and unwelcome sexual attention or
|
||||||
advances
|
advances
|
||||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
- Trolling, insulting/derogatory comments, and personal or political attacks
|
||||||
* Public or private harassment
|
- Public or private harassment
|
||||||
* Publishing others' private information, such as a physical or electronic
|
- Publishing others' private information, such as a physical or electronic
|
||||||
address, without explicit permission
|
address, without explicit permission
|
||||||
* Other conduct which could reasonably be considered inappropriate in a
|
- Other conduct which could reasonably be considered inappropriate in a
|
||||||
professional setting
|
professional setting
|
||||||
|
|
||||||
## Our Responsibilities
|
## Our Responsibilities
|
||||||
|
|
12
README.md
12
README.md
|
@ -11,17 +11,18 @@ See ["Caching dependencies to speed up workflows"](https://help.github.com/githu
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Pre-requisites
|
### Pre-requisites
|
||||||
|
|
||||||
Create a workflow `.yml` file in your repositories `.github/workflows` directory. An [example workflow](#example-workflow) is available below. For more information, reference the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).
|
Create a workflow `.yml` file in your repositories `.github/workflows` directory. An [example workflow](#example-workflow) is available below. For more information, reference the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).
|
||||||
|
|
||||||
### Inputs
|
### Inputs
|
||||||
|
|
||||||
* `path` - A directory to store and save the cache
|
- `path` - A directory to store and save the cache
|
||||||
* `key` - An explicit key for restoring and saving the cache
|
- `key` - An explicit key for restoring and saving the cache
|
||||||
* `restore-keys` - An ordered list of keys to use for restoring the cache if no cache hit occurred for key
|
- `restore-keys` - An ordered list of keys to use for restoring the cache if no cache hit occurred for key
|
||||||
|
|
||||||
### Outputs
|
### Outputs
|
||||||
|
|
||||||
* `cache-hit` - A boolean value to indicate an exact match was found for the key
|
- `cache-hit` - A boolean value to indicate an exact match was found for the key
|
||||||
|
|
||||||
> See [Skipping steps based on cache-hit](#Skipping-steps-based-on-cache-hit) for info on using this output
|
> See [Skipping steps based on cache-hit](#Skipping-steps-based-on-cache-hit) for info on using this output
|
||||||
|
|
||||||
|
@ -89,6 +90,7 @@ A repository can have up to 5GB of caches. Once the 5GB limit is reached, older
|
||||||
Using the `cache-hit` output, subsequent steps (such as install or build) can be skipped when a cache hit occurs on the key.
|
Using the `cache-hit` output, subsequent steps (such as install or build) can be skipped when a cache hit occurs on the key.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
@ -107,7 +109,9 @@ steps:
|
||||||
> Note: The `id` defined in `actions/cache` must match the `id` in the `if` statement (i.e. `steps.[ID].outputs.cache-hit`)
|
> Note: The `id` defined in `actions/cache` must match the `id` in the `if` statement (i.e. `steps.[ID].outputs.cache-hit`)
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
We would love for you to contribute to `@actions/cache`, pull requests are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
We would love for you to contribute to `@actions/cache`, pull requests are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
The scripts and documentation in this project are released under the [MIT License](LICENSE)
|
The scripts and documentation in this project are released under the [MIT License](LICENSE)
|
||||||
|
|
34
examples.md
34
examples.md
|
@ -31,6 +31,7 @@
|
||||||
- [Swift - Swift Package Manager](#swift---swift-package-manager)
|
- [Swift - Swift Package Manager](#swift---swift-package-manager)
|
||||||
|
|
||||||
## C# - NuGet
|
## C# - NuGet
|
||||||
|
|
||||||
Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/package-references-in-project-files#locking-dependencies):
|
Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/package-references-in-project-files#locking-dependencies):
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
@ -44,7 +45,9 @@ Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/packa
|
||||||
|
|
||||||
Depending on the environment, huge packages might be pre-installed in the global cache folder.
|
Depending on the environment, huge packages might be pre-installed in the global cache folder.
|
||||||
If you do not want to include them, consider to move the cache folder like below.
|
If you do not want to include them, consider to move the cache folder like below.
|
||||||
>Note: This workflow does not work for projects that require files to be placed in user profile package folder
|
|
||||||
|
> Note: This workflow does not work for projects that require files to be placed in user profile package folder
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
env:
|
env:
|
||||||
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
|
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
|
||||||
|
@ -58,6 +61,7 @@ steps:
|
||||||
```
|
```
|
||||||
|
|
||||||
## Elixir - Mix
|
## Elixir - Mix
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
|
@ -126,7 +130,7 @@ We cache the elements of the Cabal store separately, as the entirety of `~/.caba
|
||||||
|
|
||||||
For npm, cache files are stored in `~/.npm` on Posix, or `%AppData%/npm-cache` on Windows. See https://docs.npmjs.com/cli/cache#cache
|
For npm, cache files are stored in `~/.npm` on Posix, or `%AppData%/npm-cache` on Windows. See https://docs.npmjs.com/cli/cache#cache
|
||||||
|
|
||||||
>Note: It is not recommended to cache `node_modules`, as it can break across Node versions and won't work with `npm ci`
|
> Note: It is not recommended to cache `node_modules`, as it can break across Node versions and won't work with `npm ci`
|
||||||
|
|
||||||
### macOS and Ubuntu
|
### macOS and Ubuntu
|
||||||
|
|
||||||
|
@ -171,7 +175,8 @@ For npm, cache files are stored in `~/.npm` on Posix, or `%AppData%/npm-cache` o
|
||||||
|
|
||||||
## Node - Lerna
|
## Node - Lerna
|
||||||
|
|
||||||
>Note this example uses the new multi-paths feature and is only available at `master`
|
> Note this example uses the new multi-paths feature and is only available at `master`
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: restore lerna
|
- name: restore lerna
|
||||||
uses: actions/cache@master
|
uses: actions/cache@master
|
||||||
|
@ -183,6 +188,7 @@ For npm, cache files are stored in `~/.npm` on Posix, or `%AppData%/npm-cache` o
|
||||||
```
|
```
|
||||||
|
|
||||||
## Node - Yarn
|
## Node - Yarn
|
||||||
|
|
||||||
The yarn cache directory will depend on your operating system and version of `yarn`. See https://yarnpkg.com/lang/en/docs/cli/cache/ for more info.
|
The yarn cache directory will depend on your operating system and version of `yarn`. See https://yarnpkg.com/lang/en/docs/cli/cache/ for more info.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
@ -200,7 +206,9 @@ The yarn cache directory will depend on your operating system and version of `ya
|
||||||
```
|
```
|
||||||
|
|
||||||
## OCaml/Reason - esy
|
## OCaml/Reason - esy
|
||||||
|
|
||||||
Esy allows you to export built dependencies and import pre-built dependencies.
|
Esy allows you to export built dependencies and import pre-built dependencies.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Restore Cache
|
- name: Restore Cache
|
||||||
id: restore-cache
|
id: restore-cache
|
||||||
|
@ -226,7 +234,6 @@ Esy allows you to export built dependencies and import pre-built dependencies.
|
||||||
if: steps.restore-cache.outputs.cache-hit != 'true'
|
if: steps.restore-cache.outputs.cache-hit != 'true'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## PHP - Composer
|
## PHP - Composer
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
@ -247,11 +254,13 @@ Esy allows you to export built dependencies and import pre-built dependencies.
|
||||||
For pip, the cache directory will vary by OS. See https://pip.pypa.io/en/stable/reference/pip_install/#caching
|
For pip, the cache directory will vary by OS. See https://pip.pypa.io/en/stable/reference/pip_install/#caching
|
||||||
|
|
||||||
Locations:
|
Locations:
|
||||||
- Ubuntu: `~/.cache/pip`
|
|
||||||
- Windows: `~\AppData\Local\pip\Cache`
|
- Ubuntu: `~/.cache/pip`
|
||||||
- macOS: `~/Library/Caches/pip`
|
- Windows: `~\AppData\Local\pip\Cache`
|
||||||
|
- macOS: `~/Library/Caches/pip`
|
||||||
|
|
||||||
### Simple example
|
### Simple example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
|
@ -294,6 +303,7 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
|
||||||
### Using pip to get cache location
|
### Using pip to get cache location
|
||||||
|
|
||||||
> Note: This requires pip 20.1+
|
> Note: This requires pip 20.1+
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Get pip cache dir
|
- name: Get pip cache dir
|
||||||
id: pip-cache
|
id: pip-cache
|
||||||
|
@ -312,6 +322,7 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
|
||||||
### Using a script to get cache location
|
### Using a script to get cache location
|
||||||
|
|
||||||
> Note: This uses an internal pip API and may not always work
|
> Note: This uses an internal pip API and may not always work
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Get pip cache dir
|
- name: Get pip cache dir
|
||||||
id: pip-cache
|
id: pip-cache
|
||||||
|
@ -331,11 +342,13 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
|
||||||
For renv, the cache directory will vary by OS. Look at https://rstudio.github.io/renv/articles/renv.html#cache
|
For renv, the cache directory will vary by OS. Look at https://rstudio.github.io/renv/articles/renv.html#cache
|
||||||
|
|
||||||
Locations:
|
Locations:
|
||||||
- Ubuntu: `~/.local/share/renv`
|
|
||||||
- macOS: `~/Library/Application Support/renv`
|
- Ubuntu: `~/.local/share/renv`
|
||||||
- Windows: `%LOCALAPPDATA%/renv`
|
- macOS: `~/Library/Application Support/renv`
|
||||||
|
- Windows: `%LOCALAPPDATA%/renv`
|
||||||
|
|
||||||
### Simple example
|
### Simple example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
|
@ -385,6 +398,7 @@ Replace `~/.local/share/renv` with the correct `path` if not using Ubuntu.
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-gems-
|
${{ runner.os }}-gems-
|
||||||
```
|
```
|
||||||
|
|
||||||
When dependencies are installed later in the workflow, we must specify the same path for the bundler.
|
When dependencies are installed later in the workflow, we must specify the same path for the bundler.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
"build": "tsc && ncc build -o dist/restore src/restore.ts && ncc build -o dist/save src/save.ts",
|
"build": "tsc && ncc build -o dist/restore src/restore.ts && ncc build -o dist/save src/save.ts",
|
||||||
"test": "tsc --noEmit && jest --coverage",
|
"test": "tsc --noEmit && jest --coverage",
|
||||||
"lint": "eslint **/*.ts --cache",
|
"lint": "eslint **/*.ts --cache",
|
||||||
"format": "prettier --write **/*.ts",
|
"format": "prettier --write **/*.{md,ts}",
|
||||||
"format-check": "prettier --check **/*.ts"
|
"format-check": "prettier --check **/*.{md,ts}"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
Loading…
Reference in New Issue