Skip to content

Commit

Permalink
feat: use large machine
Browse files Browse the repository at this point in the history
  • Loading branch information
SyMind committed Dec 4, 2024
1 parent 36abfcc commit e864b40
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 20 deletions.
8 changes: 4 additions & 4 deletions .github/actions/download-artifact/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Download Artifact
description: Download file to local or artifact to quickly share files between jobs

inputs:
type:
cache-type:
description: "Use github, local or lynx cache"
required: true
type: string
Expand All @@ -23,12 +23,12 @@ runs:
steps:
- name: Download artifact from github
uses: actions/[email protected]
if: ${{ inputs.type == 'github' }}
if: ${{ inputs.cache-type == 'github' }}
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
- name: Download artifact from local
if: ${{ inputs.type == 'local' }}
if: ${{ inputs.cache-type == 'local' }}
shell: bash
run: |
set -e
Expand All @@ -37,7 +37,7 @@ runs:
ln -sf $save_dir/* ${{ inputs.path }}
echo "ln -sf $save_dir/* ${{ inputs.path }}"
- name: Download artifact from lynx
if: ${{ inputs.type == 'lynx' }}
if: ${{ inputs.cache-type == 'lynx' }}
uses: lynx-infra/cache/restore@main
with:
path: ${{ inputs.path }}
Expand Down
22 changes: 10 additions & 12 deletions .github/actions/upload-artifact/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ name: Upload Artifact
description: Upload file to local or artifact to quickly share files between jobs

inputs:
name:
description: "Artifact name"
default: "artifact"
path:
description: "A file, directory or wildcard pattern that describes what to upload"
required: true
type:
cache-type:
description: "Use github or local or lynx cache"
required: true
type: string
choices:
- github
- local
- lynx
name:
description: "Artifact name"
default: "artifact"
path:
description: "A file, directory or wildcard pattern that describes what to upload"
required: true

outputs:
runner-labels:
Expand All @@ -28,7 +28,7 @@ runs:
steps:
- name: Upload artifact
uses: actions/upload-artifact@v4
if: ${{ inputs.type == 'github' }}
if: ${{ inputs.cache-type == 'github' }}
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
Expand All @@ -37,12 +37,10 @@ runs:

- name: Upload artifact
uses: lynx-infra/cache/save@main
if: ${{ inputs.type == 'lynx' }}
if: ${{ inputs.cache-type == 'lynx' }}
with:
path: ${{ inputs.path }}
key: rust-artifact-${{ github.repository_id }}-${{ github.sha }}-${{ inputs.name }}
restore-keys: |
rust-artifact-${{ github.repository_id }}-${{ github.sha }}-${{ inputs.name }}
env:
ACCESS_KEY: ${{ env.TOS_ACCESS_KEY }}
SECRET_KEY: ${{ env.TOS_SECRET_KEY }}
Expand All @@ -52,7 +50,7 @@ runs:

- name: Upload local
id: upload-local
if: ${{ inputs.type == 'local' }}
if: ${{ inputs.cache-type == 'local' }}
shell: bash
run: |
set -e
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/get-runner-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ jobs:
echo "MACOS_CACHE_TYPE=$MACOS_CACHE_TYPE" >> "$GITHUB_OUTPUT"
# TODO: test
echo "WINDOWS_RUNNER_LABELS='"volc-windows-2022-medium"'" >> "$GITHUB_OUTPUT"
echo "WINDOWS_RUNNER_LABELS='"rspack-windows-2022-large"'" >> "$GITHUB_OUTPUT"
echo "WINDOWS_RUNNER_TYPE=k8s" >> "$GITHUB_OUTPUT"
echo "WINDOWS_CACHE_TYPE=lynx" >> "$GITHUB_OUTPUT"
6 changes: 3 additions & 3 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ jobs:
uses: ./.github/actions/upload-artifact
if: ${{ steps.check_cache.outputs.exists != 'true' && !inputs.skipable }}
with:
type: ${{ inputs.cache-type }}
cache-type: ${{ inputs.cache-type }}
name: bindings-${{ inputs.target }}
path: crates/node_binding/*.node

Expand All @@ -258,7 +258,7 @@ jobs:
- name: Download bindings
uses: ./.github/actions/download-artifact
with:
type: ${{ inputs.cache-type }}
cache-type: ${{ inputs.cache-type }}
name: bindings-${{ inputs.target }}
path: crates/node_binding/

Expand Down Expand Up @@ -311,7 +311,7 @@ jobs:
if: ${{ !inputs.skipable }}
uses: ./.github/actions/download-artifact
with:
type: ${{ inputs.cache-type }}
cache-type: ${{ inputs.cache-type }}
name: bindings-${{ inputs.target }}
path: crates/node_binding/

Expand Down

0 comments on commit e864b40

Please sign in to comment.