Skip to content
This repository was archived by the owner on Oct 9, 2024. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: ci

on:
push:
branches: [main]
pull_request:
branches: [main]
Comment on lines +5 to +7
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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.


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
Copy link
Member

Choose a reason for hiding this comment

The 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