Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
name: master

on:
push:
branches: [master]
#push:
# branches: [master]
workflow_dispatch:

jobs:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ __tests__/runner/*

node_modules/
lib/
package-lock.json

# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
# Logs
Expand Down
28 changes: 18 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# minio-cache
# minio-action-cache

This action allows to cache your dependencies stored in Minio (or other S3 compatible source).
This action allows to cache your dependencies in Minio (or other S3-compatible service).

Self-hosted runners supported
Self-hosted runners supported and encouraged.

## Usage

1. Instal and run https://min.io server
1. Deploy a https://min.io server

2. Create `.github/workflows/my-cachable-workflow.yml` file

Expand All @@ -24,15 +24,14 @@ jobs:
dependencies:
runs-on: [self-hosted]
steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v3
- name: Restore yarn cache
id: cache
uses: whalemare/minio-cache
uses: infovista-opensource/minio-action-cache@main
with:
endpoint: "192.168.1.63" # optional, default s3.amazonaws.com
port: 9000 # minio port
insecure: true # optional, use http instead of https. default false
endpoint: 'onpremcache.domain.com' # optional, default s3.amazonaws.com
port: 443 # minio port
insecure: false # optional, use http instead of https. default false
accessKey: "minioadmin" # required
secretKey: "minioadmin" # required
bucket: "bucket-name" # required
Expand All @@ -48,3 +47,12 @@ jobs:
- name: Check that dependency installed
run: yarn ts-jest -v
```

## TODO

- [ ] fallback key management
- [ ] check cache content (all restored files hash) to see if cache has to be reuploaded

## Changes from upstream

Add standalone restore/save sub-actions in order to avoid the [random post-steps order issue](https://github.com/actions/runner/issues/1657).
9 changes: 6 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "Minio cache"
author: proxyqb
name: "Minio Action Cache"
author: Infovista
description: "S3 actions cache with actions/cache@v2 passthrough"
inputs:
endpoint:
Expand Down Expand Up @@ -27,13 +27,16 @@ inputs:
key:
description: "An explicit key for restoring and saving the cache"
required: true
fallback-key:
description: "Fallback key for restoring the cache"
required: false

outputs:
cache-hit:
description: "A boolean value to indicate an exact match was found for the primary key"

runs:
using: node16
using: node24
main: "dist/restore/index.js"
post: "dist/save/index.js"
post-if: "success()"
Expand Down
4 changes: 2 additions & 2 deletions dist/restore/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29352,7 +29352,7 @@ var _async = _interopRequireDefault(__nccwpck_require__(7888));

var _querystring = _interopRequireDefault(__nccwpck_require__(3477));

var _mkdirp = _interopRequireDefault(__nccwpck_require__(346));
var _mkdirp = _interopRequireDefault(__nccwpck_require__(6186));

var _path = _interopRequireDefault(__nccwpck_require__(1017));

Expand Down Expand Up @@ -33957,7 +33957,7 @@ function parseListObjectsV2WithMetadata(xml) {

/***/ }),

/***/ 346:
/***/ 6186:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {

var path = __nccwpck_require__(1017);
Expand Down
4 changes: 2 additions & 2 deletions dist/save/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29352,7 +29352,7 @@ var _async = _interopRequireDefault(__nccwpck_require__(7888));

var _querystring = _interopRequireDefault(__nccwpck_require__(3477));

var _mkdirp = _interopRequireDefault(__nccwpck_require__(346));
var _mkdirp = _interopRequireDefault(__nccwpck_require__(6186));

var _path = _interopRequireDefault(__nccwpck_require__(1017));

Expand Down Expand Up @@ -33957,7 +33957,7 @@ function parseListObjectsV2WithMetadata(xml) {

/***/ }),

/***/ 346:
/***/ 6186:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {

var path = __nccwpck_require__(1017);
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"license": "MIT",
"main": "lib/restore.js",
"version": "1.1.14",
"engines": {
"node": ">=24"
},
"scripts": {
"watch": "tsc --watch",
"build": "tsc",
Expand Down
43 changes: 43 additions & 0 deletions restore/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "Minio Action Cache Downloader"
author: Infovista
description: "S3 actions cache with actions/cache@v2 passthrough"
inputs:
endpoint:
description: "s3 / minio endpoint, see: https://docs.min.io/docs/javascript-client-api-reference.html"
required: false
default: s3.amazonaws.com
port:
description: minio port
required: false
insecure:
description: use insecure http connection to minio
required: false
accessKey:
description: s3 / minio accessKey
required: true
secretKey:
description: s3 / minio secretKey
required: true
bucket:
description: s3 / minio bucket
required: true
path:
description: "A list of files, directories, and wildcard patterns to cache and restore"
required: true
key:
description: "An explicit key for restoring the cache"
required: true
fallback-key:
description: "Fallback key for restoring the cache"
required: false

outputs:
cache-hit:
description: "A boolean value to indicate an exact match was found for the primary key"

runs:
using: node24
main: "../dist/restore/index.js"
branding:
icon: "archive"
color: "gray-dark"
36 changes: 36 additions & 0 deletions save/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "Minio Action Cache Uploader"
author: Infovista
description: "S3 actions cache with actions/cache@v2 passthrough"
inputs:
endpoint:
description: "s3 / minio endpoint, see: https://docs.min.io/docs/javascript-client-api-reference.html"
required: false
default: s3.amazonaws.com
port:
description: minio port
required: false
insecure:
description: use insecure http connection to minio
required: false
accessKey:
description: s3 / minio accessKey
required: true
secretKey:
description: s3 / minio secretKey
required: true
bucket:
description: s3 / minio bucket
required: true
path:
description: "A list of files, directories, and wildcard patterns to cache and restore"
required: true
key:
description: "An explicit key for saving the cache"
required: true

runs:
using: node24
main: "../dist/save/index.js"
branding:
icon: "archive"
color: "gray-dark"
Loading