This repository was archived by the owner on Oct 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 88
Add minimal GHA pipeline #17
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| name: ci | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: | ||
| - ubuntu-latest | ||
| - macos-latest | ||
| # See https://github.com/ansible/ansible-language-server/issues/26 | ||
| # - windows-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Use Node | ||
| uses: actions/setup-node@v2 | ||
| with: | ||
| node-version: "12" | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| npm ci | ||
| npm run check-dependencies | ||
|
|
||
| - name: Run build | ||
| run: npm run compile | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this will need to go to a "devenv" job. |
||
|
|
||
| - name: Run test | ||
| run: npm test | ||
|
|
||
| # extra safety measure that ensures code was not modified during build | ||
| - name: Ensure the job does not produce non-checked-in files | ||
| run: git diff --exit-code | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW I don't think we need to filter branches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact it is needed because otherwise it will duplicate the jobs on any development branch, causing noise and making harder to read the checks.
If we will ever have a
stable/branch we can add it to the list but I doubt it will be too soon, if ever.Another option to avoid duplicate job runs is to remove the push condition entirely. Still that is not ideal as we may want to enable a scheduler for building main every day or week, so we would know the status of the master branch, which could deprecate for external reasons.
I checked other projects where I remember having the duplicate problem in the past and they seem to have kinda similar setup. https://github.com/ansible-community/molecule/blob/main/.github/workflows/tox.yml#L7-L10 or https://github.com/ansible-community/ansible-lint/blob/main/.github/workflows/tox.yml#L7-L10
Whatever we pick, we should ensure that we avoid duplicate check runs on PRs, regardless if it comes from a fork or from inside the repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As explained in #18 (comment) and https://github.com/ansible/ansible-language-server/pull/18/files#r710255129 — the filtering is actually harmful to our developer experience for as long as we keep using upstream for our feature branches. But I'll reiterate here — it's should be a dedicated discussion separate from this PR. I firmly believe that we mustn't filter out events until we make the DX suitable for such a setup.
So while I recognize the problem you're attempting to address, I don't believe that we should rush into replacing one annoyance with the other.