Skip to content

Commit

Permalink
refactor: enable caches by default
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric committed Jan 13, 2022
1 parent 521de72 commit c61e25f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ Here is a summary of all the variables that you can use and their purpose.
| variable | default | description |
| ---------------- | ------- | ------------------------------------------------------------------------------------ |
| `expo-version` | `''` | [Expo CLI](https://github.com/expo/expo-cli) version to install, skips when omitted. |
| `expo-cache` | `false` | If it should use the [GitHub actions cache](#using-the-built-in-cache). |
| `expo-cache` | `true` | If it should use the [GitHub actions cache](#using-the-built-in-cache). |
| `eas-version` | `''` | [EAS CLI](https://github.com/expo/eas-cli) version to install, skips when omitted. |
| `eas-cache` | `false` | If it should use the [GitHub actions cache](#using-the-built-in-cache). |
| `eas-cache` | `true` | If it should use the [GitHub actions cache](#using-the-built-in-cache). |
| `packager` | `yarn` | The package manager to use. _(e.g. `yarn` or `npm`)_ |
| `token` | `''` | The token of your Expo account |
| `patch-watchers` | `true` | If it should [patch the `fs.inotify.` limits](#enospc-errors-on-linux). |
Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ inputs:
description: Expo CLI version to install
expo-cache:
description: If Expo CLI should be cached to speed up installation
default: false
default: true
eas-version:
description: EAS CLI version to install
eas-cache:
description: If EAS CLI should be cached to speed up installation
default: false
default: true
packager:
description: The package manager used to install the CLIs
default: yarn
Expand Down
4 changes: 2 additions & 2 deletions src/actions/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export type SetupInput = ReturnType<typeof setupInput>;

export function setupInput() {
return {
easCache: getBooleanInput('eas-cache'),
easCache: !getInput('eas-cache') || getBooleanInput('eas-cache'),
easVersion: getInput('eas-version'),
expoCache: getBooleanInput('expo-cache'),
expoCache: !getInput('expo-cache') || getBooleanInput('expo-cache'),
expoVersion: getInput('expo-version'),
packager: getInput('packager') || 'yarn',
patchWatchers: !getInput('patch-watchers') || getBooleanInput('patch-watchers'),
Expand Down
6 changes: 3 additions & 3 deletions tests/actions/setup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jest.mock('../../src/worker');
describe(setupInput, () => {
it('returns object with correct defaults', () => {
expect(setupInput()).toMatchObject({
easCache: undefined,
easCache: true,
easVersion: undefined,
expoCache: undefined,
expoCache: true,
expoVersion: undefined,
packager: 'yarn',
patchWatchers: true,
Expand Down Expand Up @@ -72,7 +72,7 @@ describe(setupAction, () => {

it(`installs ${cliName} using npm`, async () => {
jest.mocked(packager.resolvePackage).mockResolvedValue('5.0.3');
await setupAction({ ...input, [cliVersion]: '5.x', packager: 'npm' });
await setupAction({ ...input, [cliVersion]: '5.x', [cliCache]: false, packager: 'npm' });
expect(packager.installPackage).toBeCalledWith(cliName, '5.0.3', 'npm');
expect(worker.installToolFromPackage).toBeCalled();
});
Expand Down

0 comments on commit c61e25f

Please sign in to comment.