Compare commits

..

11 Commits

Author SHA1 Message Date
Bishal Prasad
8f35dac68e streamToBuffer logging 2023-03-23 22:26:57 +05:30
Bishal Prasad
938b484130 add more logs 2023-03-23 16:59:47 +05:30
Bishal Prasad
eff27e646c Add paralleExecute index to logs 2023-03-23 10:23:51 +05:30
Vipul
04f198bf0b Merge pull request #1132 from vorburger/bazel-example
Bazel example (Take #2️⃣)
2023-03-21 12:15:41 +05:30
Vipul
bd9b49b6c3 Merge branch 'main' into bazel-example 2023-03-21 12:10:48 +05:30
Lovepreet Singh
ea0503788c Merge pull request #1122 from actions/pdotl-patch-1
Update Cross-OS Caching tips
2023-03-17 13:09:54 +05:30
Michael Vorburger ⛑️
8f2671f18e Merge branch 'main' into bazel-example 2023-03-13 06:27:49 -07:00
Michael Vorburger ⛑️
6f1f1e10f3 Clarify that macos-latest image has bazelisk 2023-03-13 14:26:31 +01:00
Michael Vorburger ⛑️
4b8460cbff Create separate Linux/macOS examples for Bazel 2023-03-13 10:52:18 +01:00
Michael Vorburger
ef11f54eee Fix example for Bazel 2023-03-11 19:54:11 +01:00
David Bernard
4b381be638 Add example for Bazel 2023-03-11 19:21:37 +01:00
2 changed files with 45 additions and 1 deletions

13
dist/restore/index.js vendored
View File

@@ -28332,6 +28332,7 @@ class Batch {
}
this.concurrency = concurrency;
this.emitter = new events.EventEmitter();
this.index = 0;
}
/**
* Add a operation into queue.
@@ -28385,6 +28386,8 @@ class Batch {
*
*/
parallelExecute() {
const local_index = this.index++;
console.log(`parallelExecute ${local_index} Active count: ${this.actives} Completed count: ${this.completed} total: ${this.operations.length}`);
if (this.state === BatchStates.Error) {
return;
}
@@ -28395,6 +28398,7 @@ class Batch {
while (this.actives < this.concurrency) {
const operation = this.nextOperation();
if (operation) {
console.log(`parallelExecute ${local_index} starting execution of operation ${this.offset}. Active count: ${this.actives}`);
operation();
}
else {
@@ -28833,15 +28837,21 @@ async function streamToBuffer(stream, buffer, offset, end, encoding) {
let pos = 0; // Position in stream
const count = end - offset; // Total amount of data needed in stream
return new Promise((resolve, reject) => {
const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), REQUEST_TIMEOUT);
const timeout = setTimeout(() => {
console.log("Timeout triggered.");
return reject(new Error(`The operation cannot be completed in timeout.`));
}, REQUEST_TIMEOUT);
stream.on("readable", () => {
console.log("Entering readable");
if (pos >= count) {
clearTimeout(timeout);
console.log("Leaving readable");
resolve();
return;
}
let chunk = stream.read();
if (!chunk) {
console.log("Leaving readable");
return;
}
if (typeof chunk === "string") {
@@ -28851,6 +28861,7 @@ async function streamToBuffer(stream, buffer, offset, end, encoding) {
const chunkLength = pos + chunk.length > count ? count - pos : chunk.length;
buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength);
pos += chunkLength;
console.log("Leaving readable");
});
stream.on("end", () => {
clearTimeout(timeout);

View File

@@ -39,6 +39,7 @@
- [Swift, Objective-C - CocoaPods](#swift-objective-c---cocoapods)
- [Swift - Swift Package Manager](#swift---swift-package-manager)
- [Swift - Mint](#swift---mint)
- [* - Bazel](#---bazel)
## C# - NuGet
@@ -657,3 +658,35 @@ steps:
restore-keys: |
${{ runner.os }}-mint-
```
## * - Bazel
[`bazelisk`](https://github.com/bazelbuild/bazelisk) does not have be to separately downloaded and installed because it's already included in GitHub's `ubuntu-latest` and `macos-latest` base images.
### Linux
```yaml
- name: Cache Bazel
uses: actions/cache@v3
with:
path: |
~/.cache/bazel
key: ${{ runner.os }}-bazel-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE', 'WORKSPACE.bazel', 'MODULE.bazel') }}
restore-keys: |
${{ runner.os }}-bazel-
- run: bazelisk test //...
```
### macOS
```yaml
- name: Cache Bazel
uses: actions/cache@v3
with:
path: |
/private/var/tmp/_bazel_runner/
key: ${{ runner.os }}-bazel-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE', 'WORKSPACE.bazel', 'MODULE.bazel') }}
restore-keys: |
${{ runner.os }}-bazel-
- run: bazelisk test //...
```