Skip to content

Merge pull request #2132 from MeilCli/update/action #4436

Merge pull request #2132 from MeilCli/update/action

Merge pull request #2132 from MeilCli/update/action #4436

Workflow file for this run

name: Test
on:
push:
branches:
- master
pull_request:
jobs:
operator-add:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./testing/create
- uses: ./operator/add
with:
function: |
() => add({path: "test/path3.txt", rule: "test-rule-ext", message: "hello", level: "notice"})
- uses: ./testing/expect
with:
expect_data_json: |
[
{
"path": "test/path1.txt",
"rule": "test-rule1",
"message": "test message",
"level": "notice"
},
{
"path": "test/path1.txt",
"rule": "test-rule2",
"message": "test message",
"level": "warning",
"startLine": 1,
"startColumn": 10,
"endLine": 1,
"endColumn": 15
},
{
"path": "test/path2.txt",
"rule": "test-rule2",
"message": "test message",
"level": "failure",
"startLine": 1,
"startColumn": 10,
"endLine": 1,
"endColumn": 15
},
{
"path": "test/path3.txt",
"rule": "test-rule-ext",
"message": "hello",
"level": "notice"
}
]
operator-filter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./testing/create
- uses: ./operator/filter
with:
function: |
(x) => x.path != "test/path1.txt"
- uses: ./testing/expect
with:
expect_data_json: |
[
{
"path": "test/path2.txt",
"rule": "test-rule2",
"message": "test message",
"level": "failure",
"startLine": 1,
"startColumn": 10,
"endLine": 1,
"endColumn": 15
}
]
operator-distinct:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./testing/create
- uses: ./operator/distinct
with:
function: |
(x) => x.path
- uses: ./testing/expect
with:
expect_data_json: |
[
{
"path": "test/path1.txt",
"rule": "test-rule1",
"message": "test message",
"level": "notice"
},
{
"path": "test/path2.txt",
"rule": "test-rule2",
"message": "test message",
"level": "failure",
"startLine": 1,
"startColumn": 10,
"endLine": 1,
"endColumn": 15
}
]
operator-map:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./testing/create
- uses: ./operator/map
with:
function: |
(x) => Object.assign(x, {message: "message: " + x.message})
- uses: ./testing/expect
with:
expect_data_json: |
[
{
"path": "test/path1.txt",
"rule": "test-rule1",
"message": "message: test message",
"level": "notice"
},
{
"path": "test/path1.txt",
"rule": "test-rule2",
"message": "message: test message",
"level": "warning",
"startLine": 1,
"startColumn": 10,
"endLine": 1,
"endColumn": 15
},
{
"path": "test/path2.txt",
"rule": "test-rule2",
"message": "message: test message",
"level": "failure",
"startLine": 1,
"startColumn": 10,
"endLine": 1,
"endColumn": 15
}
]