Coder Social home page Coder Social logo

setup-p4's People

Contributors

aboutte avatar dependabot[bot] avatar jase-perf avatar p4paul avatar ryanlitalien avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

setup-p4's Issues

node.js v12 actions are deprecated and will be forced to v16 next week

https://github.blog/changelog/2023-05-04-github-actions-all-actions-will-run-on-node16-instead-of-node12/
As of May 18th, all actions will be forced to run run under node.js v16

Expected Behavior

No warnings when the action is used in a build.

Current Behavior

Warning when this action is used in a build:

Node.js 12 actions are deprecated. Please update the following actions to use Node.js 16: perforce/setup-p4@v1. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.

TypeError: arguments.includes is not a function

After merging in #50 integration tests started failing with the following error:

(node:1684) UnhandledPromiseRejectionWarning: TypeError: arguments.includes is not a function
    at main (/home/runner/work/setup-p4-example-build-template/setup-p4-example-build-template/.github/actions/setup-p4/dist/index.js:13710:19)
    at setupP4 (/home/runner/work/setup-p4-example-build-template/setup-p4-example-build-template/.github/actions/setup-p4/dist/index.js:13646:3)
    at /home/runner/work/setup-p4-example-build-template/setup-p4-example-build-template/.github/actions/setup-p4/dist/index.js:13793:1
    at /home/runner/work/setup-p4-example-build-template/setup-p4-example-build-template/.github/actions/setup-p4/dist/index.js:13795:3
    at Object.<anonymous> (/home/runner/work/setup-p4-example-build-template/setup-p4-example-build-template/.github/actions/setup-p4/dist/index.js:13798:12)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:10[27](https://github.com/perforce/setup-p4-example-build-template/runs/5500668658?check_suite_focus=true#step:6:27):10)
    at Module.load (internal/modules/cjs/loader.js:863:[32](https://github.com/perforce/setup-p4-example-build-template/runs/5500668658?check_suite_focus=true#step:6:32))
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
(node:1684) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:1684) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Here is an example.

Remove `setup` input

The setup input was used originally to ease some of the javascript but it is really unnecessary. Now that we are getting close to releasing and we are focusing on ease of use for the end user we should remove this input.

The new plan is to always run the setup routine and rely on caching to keep step execution fast. The different use cases that need to be supported are:

  1. if p4_version is not changed then the default version will get installed with the very first setup-p4 step
  2. if p4_version is changed in the first step we will install the requested version
  3. if p4_version is changed in a subsequent step we will download and install the secondary version
  4. if p4_version is left as default for step A, changed in step B, and again left as default in step C then in step C we should use the cached version in the step A
  smoke:
    name: smoke
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-20.04]
    steps:
      - name: p4 info 21.2
        uses: ./
        with:
          command: -V
  smoke:
    name: smoke
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-20.04]
    steps:
      - name: p4 info 20.1
        uses: ./
        with:
          p4_version: 20.1
          command: -V
  smoke:
    name: smoke
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-20.04]
    steps:
      - name: p4 info 21.2
        uses: ./
        with:
          command: -V
      - name: p4 info 20.1
        uses: ./
        with:
          p4_version: 20.1
          command: -V
  smoke:
    name: smoke
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-20.04]
    steps:
      - name: p4 info 21.2
        uses: ./
        with:
          command: -V
      - name: p4 info 20.1
        uses: ./
        with:
          p4_version: 20.1
          command: -V
      - name: p4 info 21.2
        uses: ./
        with:
          command: -V

Add a timeout to all shelljs exec

Depending on what arguments are used it is possible p4 will expect user input forever. An example is the following:

      - name: p4 submit
        uses: setup-p4
        id: submit
        env:
          P4CLIENT: ci
        with:
          command: submit
          global_options: -I
          working_directory: "C:/Users/perforce/Perforce/ci/Game/"

Without -d being included in arguments p4 expects input from an interactive user.

Remove setup command

For the original js implementation I hijacked command: setup attribute to perform the installation, caching, etc of p4. It would be better to remove this and perform setup when p4_version is included.

Allow environment variables in `working_directory`

After dropping to the shell the expanded working directory on Linux was set to expanded working directory is set to: .%0A. I added .trim() to remove leading and trailing whitespace.

After dropping to the shell the expanded working directory on windwos was set to: 'working_directory' set to ".". I added .replace(/['"]+/g, '') to remove single and double quotes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.