From 406d26d44af7039a4dbc9dad32812fee059558f7 Mon Sep 17 00:00:00 2001 From: k1LoW Date: Sat, 27 Jan 2024 18:52:21 +0900 Subject: [PATCH 1/2] Support working directory (`workdir:`) --- .github/workflows/integration.yml | 11 +++++++++++ action.yml | 8 +++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index a77c202..a58a978 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -14,3 +14,14 @@ jobs: - uses: ./ with: config: testdata/path/to/config.yml + test-run-with-workdir: + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ./ + with: + config: config.yml + workdir: testdata/path/to diff --git a/action.yml b/action.yml index fc790a1..3b02f91 100644 --- a/action.yml +++ b/action.yml @@ -19,6 +19,10 @@ inputs: config: description: Config path required: false + workdir: + description: Working directory + default: '' + required: false runs: using: 'composite' steps: @@ -39,7 +43,9 @@ runs: const inputs = ${{ toJSON(inputs) }}; const toolpath = await io.which('octocov', true) const opt = `--config=${inputs.config}` - await exec.exec(`${toolpath} ${opt}`) + const options = {}; + options.cwd = inputs.workdir; + await exec.exec(`${toolpath} ${opt}`, [], options) env: OCTOCOV_GITHUB_TOKEN: ${{ inputs.github-token }} From b1c29b18b936b29f6029ec0a2895bfa58fdd3400 Mon Sep 17 00:00:00 2001 From: k1LoW Date: Sat, 27 Jan 2024 18:55:10 +0900 Subject: [PATCH 2/2] bonsai --- .github/workflows/integration.yml | 3 +-- testdata/path/to/{config.yml => .octocov.yml} | 0 2 files changed, 1 insertion(+), 2 deletions(-) rename testdata/path/to/{config.yml => .octocov.yml} (100%) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index a58a978..ef2192c 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v4 - uses: ./ with: - config: testdata/path/to/config.yml + config: testdata/path/to/.octocov.yml test-run-with-workdir: strategy: matrix: @@ -23,5 +23,4 @@ jobs: - uses: actions/checkout@v4 - uses: ./ with: - config: config.yml workdir: testdata/path/to diff --git a/testdata/path/to/config.yml b/testdata/path/to/.octocov.yml similarity index 100% rename from testdata/path/to/config.yml rename to testdata/path/to/.octocov.yml