Skip to content

chore: bump vitest from 3.2.4 to 4.0.18 (#655) #1660

chore: bump vitest from 3.2.4 to 4.0.18 (#655)

chore: bump vitest from 3.2.4 to 4.0.18 (#655) #1660

Workflow file for this run

name: Test
on:
workflow_dispatch:
pull_request:
push:
branches: [main]
jobs:
test-action-save-file:
name: Test Action to Save File
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-14, windows-2022]
steps:
- name: Checkout Action
uses: actions/checkout@v6.0.2
with:
path: cache-action
sparse-checkout: |
dist/action/main.bundle.mjs
dist/action/post.bundle.mjs
action.yml
sparse-checkout-cone-mode: false
- name: Save Cache
id: save-cache
uses: ./cache-action
with:
key: a-key-${{ matrix.os }}
version: ${{ github.run_id }}
files: |
a-file another-file
a-dir/a-file
- name: Check Output
shell: bash
run: test "${{ steps.save-cache.outputs.restored }}" == "false"
- name: Prepare Files
shell: bash
run: |
echo "a content" >> a-file
echo "another content" >> another-file
mkdir a-dir
echo "a content" >> a-dir/a-file
test-action-restore-file:
name: Test Action to Restore File
needs: test-action-save-file
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-14, windows-2022]
steps:
- name: Checkout Action
uses: actions/checkout@v6.0.2
with:
path: cache-action
sparse-checkout: |
dist/action/main.bundle.mjs
dist/action/post.bundle.mjs
action.yml
sparse-checkout-cone-mode: false
- name: Restore Cache
id: restore-cache
uses: ./cache-action
with:
key: a-key-${{ matrix.os }}
version: ${{ github.run_id }}
files: |
a-file another-file
a-dir/a-file
- name: Check Output
shell: bash
run: test "${{ steps.restore-cache.outputs.restored }}" == "true"
- name: Check Files
shell: bash
run: |
test "$(cat a-file)" == "a content"
test "$(cat another-file)" == "another content"
test "$(cat a-dir/a-file)" == "a content"
test-restore-and-save-sub-actions:
name: Test Restore and Save Sub-Actions
needs: test-action-save-file
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-14, windows-2022]
steps:
- name: Checkout Action
uses: actions/checkout@v6.0.2
with:
path: cache-action
sparse-checkout: |
dist/action/restore.bundle.mjs
dist/action/save.bundle.mjs
restore/action.yml
save/action.yml
sparse-checkout-cone-mode: false
- name: Restore Non-Existing Cache
id: restore-non-existing-cache
uses: ./cache-action/restore
with:
key: another-key-${{ matrix.os }}
version: ${{ github.run_id }}
- name: Check Output
shell: bash
run: test "${{ steps.restore-non-existing-cache.outputs.restored }}" == "false"
- name: Prepare Files
shell: bash
run: |
echo "a content" >> a-file
echo "another content" >> another-file
mkdir a-dir
echo "a content" >> a-dir/a-file
- name: Save Non-Existing Cache
id: save-non-existing-cache
uses: ./cache-action/save
with:
key: another-key-${{ matrix.os }}
version: ${{ github.run_id }}
files: |
a-file another-file
a-dir/a-file
- name: Check Output
shell: bash
run: test "${{ steps.save-non-existing-cache.outputs.saved }}" == "true"
- name: Remove Files
shell: bash
run: |
rm a-file
rm another-file
rm -r a-dir
- name: Restore Existing Cache
id: restore-existing-cache
uses: ./cache-action/restore
with:
key: another-key-${{ matrix.os }}
version: ${{ github.run_id }}
- name: Check Output
shell: bash
run: test "${{ steps.restore-existing-cache.outputs.restored }}" == "true"
- name: Check Files
shell: bash
run: |
test "$(cat a-file)" == "a content"
test "$(cat another-file)" == "another content"
test "$(cat a-dir/a-file)" == "a content"
- name: Save Existing Cache
id: save-existing-cache
uses: ./cache-action/save
with:
key: another-key-${{ matrix.os }}
version: ${{ github.run_id }}
files: |
a-file another-file
a-dir/a-file
- name: Check Output
shell: bash
run: test "${{ steps.save-existing-cache.outputs.saved }}" == "false"