From 6cfcbcf01492a82d339c2c9aac778952ad99c64f Mon Sep 17 00:00:00 2001 From: Gino Imbrailo Date: Mon, 3 Oct 2022 15:06:02 -0700 Subject: [PATCH] chore: update taqueria to version 0.20.2 (#40) * chore: update taqueria to version 0.20.2 * chore(entrypoint): refactored tests input * chore: update input in action-tests.yml * chore: change let to const * chore: change added ; to ligo files --- .github/workflows/action-tests.yml | 2 +- Dockerfile | 2 +- README.md | 10 +++++----- action.yml | 9 +++++---- contracts/counter.jsligo | 8 ++++---- contracts/counter.storages.jsligo | 2 +- entrypoint.sh | 5 +++-- 7 files changed, 20 insertions(+), 18 deletions(-) diff --git a/.github/workflows/action-tests.yml b/.github/workflows/action-tests.yml index 59a78bd..83fe064 100644 --- a/.github/workflows/action-tests.yml +++ b/.github/workflows/action-tests.yml @@ -86,7 +86,7 @@ jobs: uses: ./ with: project_directory: 'example-projects/hello-tacos' - tests: True + test_plugin: jest - name: upload artifacts uses: actions/upload-artifact@v3 diff --git a/Dockerfile b/Dockerfile index 8cc3a0f..ce141f0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ ENV DENO_DIR=/deno COPY --from=docker:dind /usr/local/bin/docker /bin/docker # Download the Taqueria release binary for Linux to /bin/taq -ADD https://github.com/ecadlabs/taqueria/releases/download/v0.19.2/taq-linux /bin/taq +ADD https://github.com/ecadlabs/taqueria/releases/download/v0.20.2/taq-linux /bin/taq # Make the binary executable RUN chmod +x /bin/taq diff --git a/README.md b/README.md index dd5b3f1..ddd0eb6 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ A docker action that helps simplify and standardize the use of [Taqueria](https://taqueria.io/) in GitHub workflows ## Taqueria version -`v0.18.0` +`v0.20.2` ## Inputs @@ -44,7 +44,7 @@ When set to true, all tests in the `tests` directory will be run using the Jest ### Single step action ```yaml - name: taqueria tasks - uses: ecadlabs/taqueria-github-action@v0.7.0 + uses: ecadlabs/taqueria-github-action@v0.8.0 with: plugins: '@taqueria/plugin-ligo, @taqueria/plugin-flextesa, @taqueria/plugin-taquito, @taqueria/plugin-jest' compile_contracts: counter.jsligo @@ -56,19 +56,19 @@ When set to true, all tests in the `tests` directory will be run using the Jest ### Multiple step action ```yaml - name: compile contracts - uses: ecadlabs/taqueria-github-action@v0.7.0 + uses: ecadlabs/taqueria-github-action@v0.8.0 with: project_directory: 'example-projects/hello-tacos' compile_contracts: 'hello-tacos.mligo' - name: start local sandbox - uses: ecadlabs/taqueria-github-action@v0.7.0 + uses: ecadlabs/taqueria-github-action@v0.8.0 with: project_directory: 'example-projects/hello-tacos' sandbox_name: 'local' - name: deploy contracts - uses: ecadlabs/taqueria-github-action@v0.7.0 + uses: ecadlabs/taqueria-github-action@v0.8.0 with: project_directory: 'example-projects/hello-tacos' deploy_contracts: hello-tacos.tz diff --git a/action.yml b/action.yml index 4a64a15..2553def 100644 --- a/action.yml +++ b/action.yml @@ -26,18 +26,19 @@ inputs: task: description: 'The task for taqueria to run' required: false - tests: - description: 'Set to True/true to run tests. The Jest plugin needs to be installed' + test_plugin: + description: If set, taqueria will run tests with using the specified plugin. Ensure that the specified plugin is installed. These test will always be run after all other jobs. required: false runs: using: 'docker' image: 'Dockerfile' args: + - ${{ inputs.compile_contracts }} + - ${{ inputs.deploy_contracts }} - ${{ inputs.environment }} - ${{ inputs.plugins }} - ${{ inputs.project_directory }} - ${{ inputs.sandbox_name }} - - ${{ inputs.deploy_contracts }} - ${{ inputs.task }} - - ${{ inputs.tests }} + - ${{ inputs.test_plugin }} diff --git a/contracts/counter.jsligo b/contracts/counter.jsligo index 3bbe451..aee9fcc 100644 --- a/contracts/counter.jsligo +++ b/contracts/counter.jsligo @@ -8,12 +8,12 @@ type parameter = type return_ = [list , storage]; /* Two entrypoints */ -let add = ([store, delta] : [storage, int]) : storage => store + delta; -let sub = ([store, delta] : [storage, int]) : storage => store - delta; +const add = ([store, delta] : [storage, int]) : storage => store + delta; +const sub = ([store, delta] : [storage, int]) : storage => store - delta; /* Main access point that dispatches to the entrypoints according to the smart contract parameter. */ -let main = ([action, store] : [parameter, storage]) : return_ => { +const main = ([action, store] : [parameter, storage]) : return_ => { return [ (list([]) as list ), // No operations (match (action, { @@ -21,4 +21,4 @@ let main = ([action, store] : [parameter, storage]) : return_ => { Decrement: (n: int) => sub ([store, n]), Reset: () => 0})) ] -} \ No newline at end of file +}; \ No newline at end of file diff --git a/contracts/counter.storages.jsligo b/contracts/counter.storages.jsligo index 3219e36..18c6255 100644 --- a/contracts/counter.storages.jsligo +++ b/contracts/counter.storages.jsligo @@ -2,4 +2,4 @@ // Define storage variable -let storage:storage = 42 \ No newline at end of file +const storage:storage = 42; \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 6db3208..15f46df 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -59,9 +59,10 @@ if [ -n "$INPUT_TASK" ] && [ "$INPUT_TASK" != "init" ]; then taq $INPUT_TASK fi -if [ "$INPUT_TESTS" == "true" ] || [ "$INPUT_TESTS" == "True" ]; then +if [ -n "$INPUT_TEST_PLUGIN" ]; then chmod -R 777 ./.taq - taq test + echo "Running tests using plugin $INPUT_TEST_PLUGIN" + taq test --plugin $INPUT_TEST_PLUGIN exit_code=$? chmod -R 755 ./.taq exit $exit_code