-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
254,181 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"env": { "node": true }, | ||
"parser": "@typescript-eslint/parser", | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"prettier" | ||
], | ||
"plugins": ["@typescript-eslint"], | ||
"root": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: "Setup" | ||
description: "Setup Node, PNPM, and install dependencies" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 7 | ||
run_install: false | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- id: pnpm-cache | ||
shell: bash | ||
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: ${{ runner.os }}-pnpm-store- | ||
|
||
- run: pnpm install --prefer-offline | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Test | ||
on: push | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup | ||
uses: ./.github/actions/setup | ||
|
||
- name: Run Lint | ||
run: pnpm lint | ||
|
||
- name: Build | ||
run: pnpm build | ||
|
||
- name: Check working copy | ||
run: git diff --exit-code | ||
|
||
- name: Run TurboRepo Remote Cache Server | ||
uses: ./ | ||
with: | ||
port: 42042 | ||
storage-provider: local | ||
storage-path: test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# TurboRepo Remote Cache GitHub Action | ||
|
||
A GitHub action which runs a [ducktors/turborepo-remote-cache](https://github.com/ducktors/turborepo-remote-cache) server in the background so you can use any of the non-local [supported storage providers](https://ducktors.github.io/turborepo-remote-cache/supported-storage-providers.html) to cache your TurboRepo builds. | ||
|
||
## Inputs | ||
|
||
### `storage-provider` | ||
|
||
**Required** The storage provider to use. Supports all options from [environmental variables](https://ducktors.github.io/turborepo-remote-cache/environment-variables.html) for more information. | ||
|
||
### `storage-path` | ||
|
||
**Required** The name of the bucket to use. Supports all options from [environmental variables](https://ducktors.github.io/turborepo-remote-cache/environment-variables.html) for more information. | ||
|
||
### `team-id` | ||
|
||
The Team ID to use. This controls the directory where cache entries will be saved. Default `"ci"`. | ||
|
||
### `port` | ||
|
||
The port to run the server on. This is configurable in case of a port collision, but shouldn't normally need to be changed. Default `"42042"`. | ||
|
||
## Environment variables | ||
|
||
You may also need to set environment variables to provide credentials to the storage provider. See [supported storage providers](https://ducktors.github.io/turborepo-remote-cache/supported-storage-providers.html) for more information. | ||
|
||
## Example usage | ||
|
||
```yaml | ||
- uses: trappar/turborepo-remote-cache-gh-action@v1 | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
with: | ||
storage-provider: s3 | ||
storage-path: my-bucket-name | ||
``` | ||
No further configuration is required. The action will automatically set environmental variables which TurboRepo uses to connect to the remote cache server. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: "TurboRepo Remote Cache Server" | ||
description: "Runs a TurboRepo remote cache server based on ducktors/turborepo-remote-cache." | ||
author: trappar | ||
inputs: | ||
storage-provider: | ||
description: "Possible values are s3, google-cloud-storage, or azure-blob-storage. Local storage is technically supported but is useless." | ||
required: false | ||
storage-path: | ||
description: "The name of s3, google-cloud-storage, or azure-blob-storage bucket." | ||
required: false | ||
team-id: | ||
description: "Sets the TURBO_TEAM env variable, which controls the directory where cache entries will be saved." | ||
required: false | ||
default: "ci" | ||
port: | ||
description: "Port to listen on." | ||
required: false | ||
default: "42042" | ||
runs: | ||
using: "node16" | ||
main: "dist/start/index.js" | ||
post: "dist/post/index.js" |
Oops, something went wrong.