Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Action fails on Windows and MacOS #4

Closed
evandrocoan opened this issue Jul 23, 2020 · 4 comments
Closed

Action fails on Windows and MacOS #4

evandrocoan opened this issue Jul 23, 2020 · 4 comments
Assignees

Comments

@evandrocoan
Copy link

evandrocoan commented Jul 23, 2020

I had setup it to run on Linux/Window/Mac OS, but one of them if failing this that error:

  1. https://github.com/evandroforks/AppointmentPublishing/runs/903562824?check_suite_focus=true#step:4:11

image

Only now I realiaze I can only run it in one of the machines, otherwise, I would get double commits.

The correct usage would be:

jobs:

  test:

    name: Tests on ${{ matrix.os }} JDK ${{ matrix.java }}

    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        java: [1.8, 1.11]

      # Keep all systems running if something fails
      fail-fast: false

    steps:
      - uses: actions/checkout@v2

      - name: Set up JDK
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.java }}

      # Automatically format and commit code with Google style guide
      # https://github.com/axel-op/googlejavaformat-action/issues/4
      - uses: axel-op/googlejavaformat-action@v3
        if: matrix.java == '1.11' && matrix.os == 'ubuntu-latest'
        with:
          args: "--skip-sorting-imports --replace"
@axel-op
Copy link
Owner

axel-op commented Jul 23, 2020

That's because I've only built this action for Linux machines, my bad. I'll try to make this cross-platform in a future version.

Thanks for the issue!

@axel-op axel-op reopened this Jul 23, 2020
@axel-op
Copy link
Owner

axel-op commented Jul 25, 2020

Here's why this action fails on non-Linux machines:

  • On MacOS: calls to GitHub API are rejected when trying to get the releases of GJF (related to this issue). The solution would be to add a required parameter to this action for the GITHUB_TOKEN, so the calls would be authentified.
  • On Windows: the HOME environment variable is not set and I cannot figure out why.

@axel-op axel-op changed the title Downloading Google Java Format ##[error] TypeError: Cannot read property 'find' of undefined Action fails on Windows and MacOS Jul 25, 2020
@axel-op
Copy link
Owner

axel-op commented Jul 25, 2020

I managed to find a workaround on Windows, so this action will now work on this OS.

@axel-op axel-op self-assigned this Jul 28, 2020
@axel-op
Copy link
Owner

axel-op commented Aug 31, 2020

Issue "fixed" (with a workaround) with v3.3.0.

@axel-op axel-op closed this as completed Aug 31, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants