14 Commits

Author SHA1 Message Date
Trim21
fcdfcf50d1 fix test 2025-09-09 17:12:25 +00:00
Trim21
5332586197 fix test 2025-09-09 17:12:25 +00:00
Trim21
7d25465fe8 fix test 2025-09-09 17:12:25 +00:00
per1234
63fd9f48fd Use versions of Task with Apple Silicon builds in tests
The unit and integration tests install various versions of Task.

The GitHub Actions macos-latest runner was recently changed from using x86 machines to Apple Silicon/ARM machines.

Task is now built for both architectures. However, this was not done for the older versions of Task previously used for the tests. The runner architecture switch caused the tests to start failing spuriously on the macos-latest GitHub Actions workflow run jobs:

```
FAIL __tests__/main.test.ts
  installer tests
    ✕ Downloads version of Task if no matching version is installed (188 ms)
    Gets the latest release of Task
      ✕ Gets the latest version of Task 2.5 using 2.5 and no matching version is installed (174 ms)
      ✕ Gets latest version of Task using 2.x and no matching version is installed (68 ms)
      ✕ Gets preview version of Task using 3.x and no matching version is installed (167 ms)
      ✕ Skips version computing when a valid semver is provided (164 ms)

  ● installer tests › Downloads version of Task if no matching version is installed

    Failed to download version v2.6.0: Error: Unexpected HTTP response: 404

      165 |       core.debug(error.toString());
      166 |     }
    > 167 |     throw new Error(`Failed to download version ${version}: ${error}`);
          |           ^
      168 |   }
      169 |
      170 |   // Extract

      at src/installer.ts:167:11
          at Generator.throw (<anonymous>)
      at rejected (src/installer.ts:40:65)

  ● installer tests › Gets the latest release of Task › Gets the latest version of Task 2.5 using 2.5 and no matching version is installed

    Failed to download version v2.5.2: Error: Unexpected HTTP response: 404

      165 |       core.debug(error.toString());
      166 |     }
    > 167 |     throw new Error(`Failed to download version ${version}: ${error}`);
          |           ^
      168 |   }
      169 |
      170 |   // Extract

      at src/installer.ts:167:11
          at Generator.throw (<anonymous>)
      at rejected (src/installer.ts:40:65)

  ● installer tests › Gets the latest release of Task › Gets latest version of Task using 2.x and no matching version is installed

    Failed to download version v2.6.0: Error: Unexpected HTTP response: 404

      165 |       core.debug(error.toString());
      166 |     }
    > 167 |     throw new Error(`Failed to download version ${version}: ${error}`);
          |           ^
      168 |   }
      169 |
      170 |   // Extract

      at src/installer.ts:167:11
          at Generator.throw (<anonymous>)
      at rejected (src/installer.ts:40:65)

  ● installer tests › Gets the latest release of Task › Gets preview version of Task using 3.x and no matching version is installed

    Failed to download version v3.0.0-preview1: Error: Unexpected HTTP response: 404

      165 |       core.debug(error.toString());
      166 |     }
    > 167 |     throw new Error(`Failed to download version ${version}: ${error}`);
          |           ^
      168 |   }
      169 |
      170 |   // Extract

      at src/installer.ts:167:11
          at Generator.throw (<anonymous>)
      at rejected (src/installer.ts:40:65)

  ● installer tests › Gets the latest release of Task › Skips version computing when a valid semver is provided

    Failed to download version v3.0.0: Error: Unexpected HTTP response: 404

      165 |       core.debug(error.toString());
      166 |     }
    > 167 |     throw new Error(`Failed to download version ${version}: ${error}`);
          |           ^
      168 |   }
      169 |
      170 |   // Extract

      at src/installer.ts:167:11
          at Generator.throw (<anonymous>)
      at rejected (src/installer.ts:40:65)
```

```
Error: Failed to download version v3.4.1: Error: Unexpected HTTP response: 404
```

The obvious solution would be to pin the runner to the last x86 runner: macos-13 in the test runner workflows. However, GitHub phases out runners over time so this would not be a future proof solution. The chosen solution is to continue to use the Apple Silicon macos-latest runner and adjust the tests to use versions of Task for which an Apple Silicon build is available.

This was not possible for the integration test of the action's major version pinning capability. The reason is that a previous major version (2.x) must be used in this test in order to allow a consistent assertion, since the installed version would change over time if the latest major version was used. Apple Silicon builds are not available in the 2.x Task version series. For this reason, the integration test runner workflow is configured to skip that test on the macos-latest runner job. The Linux and Windows integration test runner jobs, as well as unit test (which is not constrained in this way due to using artificial tags data) will provide sufficient coverage for this capability.
2024-08-01 21:39:00 -07:00
per1234
45b4763926 Update order of imports for eslint-plugin-import@2.28.0 compliance
For some reason ESLint wants the imports in this order after the package is bumped. So be it.
2023-07-28 05:30:06 -07:00
per1234
6d4f58adcf Change project name to "arduino/setup-task"
Change project name to "arduino/setup-task"

The Task documentation consistently refers to the tool as "Task". Taskfile is the term used for Task's configuration file.
This action is setting up the Task tool, not setting up the Task configuration file, so "arduino/setup-task" is more
appropriate than "arduino/setup-taskfile".
2021-05-07 02:49:21 -07:00
per1234
9bee96a9ff Run eslint --fix on code
Make all possible automated fixes for linting violations.
2021-05-06 23:54:56 -07:00
per1234
104baaad72 Remove extraneous text from license file
In order to be recognized by GitHub's automatic license detection system, the license file must contain only the exact
license text, which can be sourced from choosealicense.com. Please do not modify this file in any way.
2021-05-03 20:44:42 -07:00
Edoardo Tenani
d8443cd660 test installing specific semver release 2021-04-21 17:50:35 +02:00
Roberto Sora
ac9c8a4eae run linter 2019-10-25 14:47:12 +02:00
Roberto Sora
9d155c2a88 add support for client with Bearer token 2019-10-25 14:26:20 +02:00
Massimiliano Pippi
93f47f8dcf prettify setup-taskfile 2019-09-17 12:21:08 +02:00
Massimiliano Pippi
f0f199da8d fix bin folder 2019-08-24 17:19:28 +02:00
Massimiliano Pippi
3fcc6951ab import sources 2019-08-23 17:30:46 +02:00