From 99ba48c332a4ddc0056d30a850368ce039a3d362 Mon Sep 17 00:00:00 2001 From: Nizar Date: Sun, 17 Mar 2024 17:50:07 +0400 Subject: [PATCH] Add directory input test (#32) --- .github/workflows/test.yml | 24 ++++++++++++++++++++++++ tests/action/directory/a/a.js | 7 +++++++ tests/action/directory/a/a.min.js | 1 + tests/action/directory/b/b.js | 7 +++++++ 4 files changed, 39 insertions(+) create mode 100644 .github/workflows/test.yml create mode 100644 tests/action/directory/a/a.js create mode 100644 tests/action/directory/a/a.min.js create mode 100644 tests/action/directory/b/b.js diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..b0712d3 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,24 @@ +name: test + +on: + push: + branches: ["master"] + pull_request: + branches: ["master"] + workflow_dispatch: + +jobs: + directory: + runs-on: ubuntu-latest + + steps: + - name: Checkout the repository + uses: actions/checkout@v4 + + - name: Targets specific directory + uses: ./ + with: + directory: "tests/action/directory/a/*" + + - name: Compare the minified files + run: git diff --exit-code diff --git a/tests/action/directory/a/a.js b/tests/action/directory/a/a.js new file mode 100644 index 0000000..1fd79f6 --- /dev/null +++ b/tests/action/directory/a/a.js @@ -0,0 +1,7 @@ +function print_hello() { + console.log('hello world from a'); +} + +window.addEventListener('load', function () { + print_hello(); +}); diff --git a/tests/action/directory/a/a.min.js b/tests/action/directory/a/a.min.js new file mode 100644 index 0000000..e939a8a --- /dev/null +++ b/tests/action/directory/a/a.min.js @@ -0,0 +1 @@ +function print_hello(){console.log("hello world from a")}window.addEventListener("load",function(){print_hello()}); \ No newline at end of file diff --git a/tests/action/directory/b/b.js b/tests/action/directory/b/b.js new file mode 100644 index 0000000..1bdde8d --- /dev/null +++ b/tests/action/directory/b/b.js @@ -0,0 +1,7 @@ +function print_hello() { + console.log('hello world from b'); +} + +window.addEventListener('load', function () { + print_hello(); +});