Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Updated the new actions toolkit and fixed multiple check issue #17

Closed
wants to merge 39 commits into from

Conversation

OmgImAlexis
Copy link

@OmgImAlexis OmgImAlexis commented Oct 7, 2019

I'd recommend squashing this commit as there are quite a few extra commits that were adding just while testing.

Changes in this PR

  • Add support for multiple checks and check name as input(defaults to "lint").
  • Fixes annotating the wrong check run when there are multiple.
  • Updates to the new actions toolkit and actions v2 template.
  • Adds a github action to check this repo again itself.

Closes #13

Have you ...

  • followed the guidelines in our Contributing document?
  • run tests locally (if applicable)?

cc/ @stoe

@OmgImAlexis OmgImAlexis requested a review from stoe as a code owner October 7, 2019 02:36
@OmgImAlexis
Copy link
Author

The issue I was having in #13 will be fixed on xo merges xojs/xo#405

Copy link
Owner

@stoe stoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great ✨, @OmgImAlexis

Left a few comments still.

Comment on lines +12 to +15
const fixXoForChildProcess = async () => {
const cliMainPath = path.join(path.dirname(fs.realpathSync(xoPath)), 'cli-main.js')
fs.writeFileSync(cliMainPath, fs.readFileSync(cliMainPath).toString().replace('process.exit(report.errorCount === 0 ? 0 : 1);', 'process.exitCode = (report.errorCount === 0 ? 0 : 1);'));
};
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this is used for?
@OmgImAlexis, can you explain, please?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a patch for this PR.

xojs/xo#405

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool.
Can you add a comment that it is a workaround for the linked PR and could be removed if it gets merged, please.

Comment on lines +6 to +22
lint:
name: Lint code
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Install deps
uses: docker://node:10-alpine
with:
entrypoint: npm
args: ci

- name: Lint
uses: docker://node:10-alpine
with:
entrypoint: npm
args: run lint
Copy link
Owner

@stoe stoe Oct 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OmgImAlexis, what do you think changing this to

  lint:
    name: Lint code on Node v${{ matrix.node }}
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node: ['10', '12', '13']

    steps:
      - uses: actions/checkout@master
      - uses: actions/setup-node@master
        with:
          node-version: ${{ matrix.node }}
      - run: npm ci
      - run: npm run lint

So it can be "tested" agains other Node versions?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it really make sense to run the linter action against a matrix? If there were test cases to check the linter execution against a matrix it would be fine. But this is actually just ensuring the linter code does not have lint issues, so node versions should not matter, if they do, this would mean code issues and thus require proper test cases.

@stale
Copy link

stale bot commented Nov 25, 2019

This issue/pr has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the 🤖 stale This will not be worked on label Nov 25, 2019
@OmgImAlexis
Copy link
Author

I'll try and get to this soon. Got stuck on other things at work.

@stale stale bot removed the 🤖 stale This will not be worked on label Nov 26, 2019
@stale
Copy link

stale bot commented Dec 26, 2019

This issue/pr has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added 🤖 stale This will not be worked on and removed 🤖 stale This will not be worked on labels Dec 26, 2019
@dougmaitelli
Copy link

Sorry to step into the discussion, but I am interested in this action and it is currently not working, so I hope to provide some feedback and maybe help fix it if that's ok.

I tried to use the current release version and faced the JSON.parse error that is mentioned in this issue: #13

Then I tried to test my project against this PR to see if that would fix the issue. This brought up two problems:

1 - The linter does not give any output regarding which errors it found
image

2 - One of the action processes got stuck forever running
image

@stoe stoe added the 🤖 backlog This issue or pull request already exists label Dec 31, 2019
@stoe stoe mentioned this pull request Dec 31, 2019
@stoe stoe closed this Jan 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🤖 backlog This issue or pull request already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug report: Unexpected token in JSON.parse
3 participants