Skip to content

docs: more badges 😎 #50

docs: more badges 😎

docs: more badges 😎 #50

Workflow file for this run

name: Tests
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
concurrency:
group: main-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
NPM_CONFIG_AUDIT: "false"
NPM_CONFIG_FUND: "false"
jobs:
checks:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Install Dependencies
run: npm install
- name: Run tsc
run: npm run build
- name: Run fmt check
run: npm run fmt-check
- name: Run lint check
run: npm run lint
audit:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v4
- run: npm install
- run: npm audit --audit-level moderate --omit dev
test-defaults:
runs-on: windows-2022
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Setup Dev Drive
uses: ./
test-inputs:
runs-on: windows-2022
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Setup Dev Drive
uses: ./
with:
drive-size: 2GB
drive-format: NTFS
drive-type: Fixed
drive-path: "my_awesome_drive.vhdx"
mount-if-exists: false
workspace-copy: true
test-large-fixed:
runs-on: windows-2022
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Setup Dev Drive
uses: ./
with:
drive-size: 10GB
drive-type: Fixed
test-large-dynamic:
runs-on: windows-2022
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Setup Dev Drive
uses: ./
with:
drive-size: 10GB
drive-type: Dynamic
test-path-with-spaces:
runs-on: windows-2022
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Setup Dev Drive
uses: ./
with:
drive-size: 50MB
drive-format: NTFS
drive-path: "path/to/my/dev drive with spaces.vhdx"
- name: Write File to Dev Drive
working-directory: ${{ env.DEV_DRIVE }}
run: New-Item test.txt
test-copy-inside-workspace:
strategy:
fail-fast: false
matrix:
runs-on: [ windows-2022 ]
workspace-copy: [ true, false ]
runs-on: ${{ matrix.runs-on }}
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Setup Dev Drive
id: setup-drive
continue-on-error: true
uses: ./
with:
drive-path: "${{ github.workspace }}/dev_drive.vhdx"
workspace-copy: ${{ matrix.workspace-copy }}
- name: Fail when `workspace-copy` and failure is not the outcome
if: ${{ matrix.workspace-copy && steps.setup-drive.outcome != 'failure' }}
run: exit 1
- name: Fail when not `workspace-copy` and success is not the outcome
if: ${{ !matrix.workspace-copy && steps.setup-drive.outcome != 'success' }}
run: exit 1
test-cache-storage:
runs-on: windows-2022
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Setup Dev Drive
uses: ./
with:
drive-size: 50MB
drive-format: NTFS
drive-path: "my_cached_drive.vhdx"
mount-if-exists: true
- name: Write File to Dev Drive
working-directory: ${{ env.DEV_DRIVE }}
run: |
New-Item test.txt
Dismount-VHD -Path ${{ env.DEV_DRIVE_PATH }}
- name: Cache Dev Drive
uses: actions/cache/save@v4
with:
path: ${{ env.DEV_DRIVE_PATH }}
key: test-cache-${{ github.run_id }}
outputs:
dev-drive-path: ${{ env.DEV_DRIVE_PATH }}
test-cache-retrieval:
runs-on: windows-2022
needs: [test-cache-storage]
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Retrieve Cached Dev Drive
uses: actions/cache/restore@v4
with:
path: ${{ needs.test-cache-storage.outputs.dev-drive-path }}
key: test-cache-${{ github.run_id }}
fail-on-cache-miss: true
- name: Setup Dev Drive
uses: ./
with:
drive-path: "my_cached_drive.vhdx"
mount-if-exists: true
- name: Check File in Dev Drive
working-directory: ${{ env.DEV_DRIVE }}
run: Test-Path test.txt -PathType Leaf