Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 120
trim_trailing_whitespace = true

[*.sh]
indent_size = 4
38 changes: 38 additions & 0 deletions .github/actions/setup_environment/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Setup Environment"
description: "Setting environment for the project"

inputs:
task-version:
description: "Task version"
required: true
default: "3.33.1"
task-enabled:
description: "Task enabled"
required: true
default: "true"
zizmor-version:
description: "Zizmor version"
required: true
default: "1.0.1"
zizmor-enabled:
description: "Zizmor enabled"
required: true
default: "false"

runs:
using: "composite"
steps:
- name: Setup Task
if: ${{ inputs.task-enabled == 'true' }}
uses: arduino/setup-task@v2.0.0
with:
version: ${{ inputs.task-version }}

- name: Setup Zizmor
if: ${{ inputs.zizmor-enabled == 'true' }}
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install "zizmor==${ZIZMOR_VERSION}"
env:
ZIZMOR_VERSION: ${{ inputs.zizmor-version }}
31 changes: 31 additions & 0 deletions .github/workflows/check-pr-title.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Check PR Title

on:
pull_request:
types:
- opened
- reopened
- synchronize
- edited

concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}
cancel-in-progress: true

jobs:
check-pr-title:
runs-on: ubuntu-latest

steps:
- name: Checkout config file
uses: actions/checkout@v4
with:
persist-credentials: false
sparse-checkout: |
commitlint.config.js
sparse-checkout-cone-mode: false

- name: Commitlint PR Title
uses: ovsds/commitlint-pr-title-action@v1
with:
config_file: ./commitlint.config.js
56 changes: 56 additions & 0 deletions .github/workflows/check-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Check PR

on:
pull_request:
types:
- opened
- reopened
- synchronize

concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}
cancel-in-progress: true

jobs:
check-pr:
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Environment
uses: ./.github/actions/setup_environment
with:
zizmor-enabled: true

- name: Install Dependencies
run: |
task init

- name: Lint PR
run: |
task lint
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Required for Zizmor

- name: Test PR
run: |
task test

- name: Package PR
run: |
task package

- name: Compare the expected and actual dist/ directories
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
50 changes: 50 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: E2E

on:
pull_request:
types:
- opened
- reopened
- synchronize

concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}
cancel-in-progress: true

jobs:
e2e-default:
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Test Run
id: test-run
uses: ./
with:
placeholder: "test_placeholder"

- name: Assert placeholder
uses: nick-fields/assert-action@v2
with:
actual: ${{ steps.test-run.outputs.placeholder }}
expected: "test_placeholder"
e2e:
runs-on: ubuntu-latest
if: always() && !cancelled()

needs:
- e2e-default

steps:
- name: Collect Results
uses: ovsds/collect-needs-result-action@v1
with:
needs_json: ${{ toJson(needs) }}
skip_allowed: false
22 changes: 22 additions & 0 deletions .github/workflows/push-version-tags.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Push version tags

on:
release:
types: [published]

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

jobs:
push-version-tags:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Push Version Tags
uses: ovsds/push-version-tags-action@v1
with:
version: ${{ github.event.release.tag_name }}
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# OS
.DS_Store

# IDE
.idea/
.vscode/

# Dependencies
node_modules/

# Build files
lib/**/*
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- commitlint --edit
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
5 changes: 5 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
fund=false
audit=false
save-exact=true
engine-strict=true
update-notifier=false
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v24.11.0
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
lib/
node_modules/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Dmitry Ovsiannikov

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.
56 changes: 55 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,55 @@
# split-matrix-action
# Split Matrix Action

[![CI](https://github.com/ovsds/split-matrix-action/workflows/Check%20PR/badge.svg)](https://github.com/ovsds/split-matrix-action/actions?query=workflow%3A%22%22Check+PR%22%22)
[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-Split%20Matrix-blue.svg)](https://github.com/marketplace/actions/split-matrix)

Split Matrix Action

## Usage

### Example

```yaml
jobs:
split-matrix:
steps:
- name: Split Matrix
id: split-matrix
uses: ovsds/split-matrix-action@v1
```

### Action Inputs

```yaml
inputs:
placeholder:
description: |
Placeholder input to be replaced by real inputs
required: true
default: "placeholder"
```

### Action Outputs

```yaml
outputs:
placeholder:
description: |
Placeholder output to be replaced by real outputs
```

## Development

### Global dependencies

- [Taskfile](https://taskfile.dev/installation/)
- [nvm](https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script)
- [zizmor](https://woodruffw.github.io/zizmor/installation/) - used for GHA security scanning

### Taskfile commands

For all commands see [Taskfile](Taskfile.yaml) or `task --list-all`.

## License

[MIT](LICENSE)
Loading