Skip to content

Commit

Permalink
Merge pull request #1 from al-cheb/first-version
Browse files Browse the repository at this point in the history
Implement first version of action
  • Loading branch information
maxim-lobanov authored May 4, 2020
2 parents 9b213ff + 92339d2 commit a52e86c
Show file tree
Hide file tree
Showing 12 changed files with 918 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Validate action
on:
pull_request:
schedule:
- cron: 0 0 * * *

jobs:
default-parameters:
strategy:
matrix:
os: [ windows-2016, windows-2019 ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: configure-pagefile-action
uses: ./
with:
minimum-size: 8GB

- name: validation
shell: pwsh
run: |
(Get-CimInstance Win32_PageFileUsage).AllocatedBaseSize
Invoke-Expression "wmic pagefile list /format:list" | Select-String "AllocatedBaseSize=", "Name="
custom-parameters:
strategy:
matrix:
os: [ windows-2016, windows-2019 ]
disk-root: [ "C:", "D:" ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: configure-pagefile-action
uses: ./
with:
minimum-size: 4GB
maximum-size: 8GB
disk-root: ${{ matrix.disk-root }}

- name: validation
shell: pwsh
run: |
(Get-CimInstance Win32_PageFileUsage).AllocatedBaseSize
Invoke-Expression "wmic pagefile list /format:list" | Select-String "AllocatedBaseSize=", "Name="
20 changes: 20 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build action
on: [pull_request]

jobs:
Build:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@master

- name: Set Node.JS
uses: actions/setup-node@master
with:
node-version: 12.x

- name: npm install
run: npm install

- name: Build
run: npm run build
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
lib
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

The MIT License (MIT)

Copyright (c) 2020 Maxim Lobanov and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,33 @@
# configure-pagefile-action
Set PageFileSize on GitHub Windows Hosted Agents
This action is intended to configure Pagefile size and location for Windows images in GitHub Actions.

# Available parameters
| Argument | Description | Format | Default value |
|----------|-------------|--------|---------------|
| `minimum-size` | Set minimum size of Pagefile | `2048MB`, `4GB`, `8GB` and etc | `8GB` |
| `maximum-size` | Set maximum size of Pagefile | The same like `minimum-size` | `minimum-size` |
| `disk-root` | Set disk root where Pagefile will be located | `C:` or `D:` | `D:` |

# Usage
```
name: CI
on: [push]
jobs:
build:
runs-on: windows-latest
steps:
- name: configure Pagefile
uses: al-cheb/[email protected]
with:
minimum-size: 8
- name: configure Pagefile
uses: al-cheb/[email protected]
with:
minimum-size: 8
maximum-size: 16
disk-root: "D:"
```

# License
The scripts and documentation in this project are released under the [MIT License](LICENSE)
21 changes: 21 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'Configure Pagefile'
author: 'Aleksandr Chebotov & Maxim Lobanov'
description: 'Configure Pagefile on Windows agents in GitHub Actions'
inputs:
minimum-size:
description: 'Set minimum size of Pagefile'
required: false
default: 8GB
maximum-size:
description: 'Set maximum size of Pagefile'
required: false
disk-root:
description: 'Set disk root where pagefile.sys will be located'
required: false
default: 'D:'
runs:
using: 'node12'
main: 'dist/index.js'
branding:
icon: 'cpu'
color: 'purple'
Loading

0 comments on commit a52e86c

Please sign in to comment.