jashkenas / backbone

Give your JS App some Backbone with Models, Views, Collections, and Events
http://backbonejs.org
MIT License
28.1k stars 5.39k forks source link

Replace travis with GH Workflows #4247

Closed ogonkov closed 2 years ago

ogonkov commented 2 years ago

Travis seems not running for few last commits. I guess GH workflows woild be more robust decision.

I can create PR.

jgonggrijp commented 2 years ago

We have three options.

Travis CI is not running because we have to migrate the repository from travis-ci.org (which stopped operating) to travis-ci.com (which should still be free for open source). I could contact @jashkenas about that, and then Travis CI would probably start working again. I already started that process for Underscore.

While I personally don't like GitHub Actions, I recognize that it would remove a dependency on an external service. If you can help me get everything to work, not just now but in the future as well (I'll eventually want to enable automatic deployment), then I welcome a pull request that replaces Travis CI by GitHub Actions.

The third option would be to mirror the repo to GitLab and use their pipelines instead. They explicitly support such usage, and I like their more straightforward, traditional DSL.

ogonkov commented 2 years ago

I can support gh actions, no prob, they very similar to gitlab ci, with more flex syntax (imho)

You want to integrate semantic release?

jgonggrijp commented 2 years ago

Eventually. For now though, let's just replace the functionality that Travis provided.

Great that you want to support this, by the way, much appreciated.

ogonkov commented 2 years ago

Sure, will look at it on weekend

ogonkov commented 2 years ago

@jgonggrijp can you please enable Actions in Settings -> Actions?

jgonggrijp commented 2 years ago

Unfortunately, no, I don't have access to the settings. I suspect Actions are enabled by default, though (at least they are on my fork of the repo), and that they're only not kicking of in your PR because the config needs to be on the default branch first.

I could just merge your PR and hope for the best. However, I noticed that you're also depending on secrets.SauceUsername and secrets.SauceAccessKey for the karma tests. I'll have to ask @jashkenas to configure those. Unless you can copy those from the old .travis.yml and hardcode them in the same way in the new .github/workflows/tests.yml. I understand that's not a best practice, but they were already public, so at least it doesn't make matters worse.

jgonggrijp commented 2 years ago

@ogonkov I'm pretty sure Actions is already enabled, because the tab is already in the navigation bar and I can start adding a workflow based on a template with the click on a button.

ogonkov commented 2 years ago

I guess Actions tab could be just a kind of promo, that always visible.

Travis has encoded secrets, i can't just copy it to Workflows, i'm afraid.

In my other repo Workflows just works from initial PR, without need to be merged in master, so i guess there should be some additional setup, to get it work.

jgonggrijp commented 2 years ago

Alright, I emailed @jashkenas for assistance. It will probably take at least a couple of days until he finds time to sort these things for us.

jgonggrijp commented 2 years ago

Jeremy replied to my email. He wrote that he will try to get to it soon.

ogonkov commented 2 years ago

Any news?

jgonggrijp commented 2 years ago

Jeremy made an attempt yesterday, but he got stuck because one piece of information in my email was incomplete and another was outdated. I provided the missing information and he'll be making another attempt. He did confirm that GH Actions was already enabled.

jgonggrijp commented 2 years ago

Update: Jeremy tried again and succeeded. However, he had no Sauce Labs credentials ready to fill the secrets with, so he left those empty. Fortunately, I should theoretically be able to set those myself using the GitHub API. I'll create my own Sauce Labs account shortly after posting this and then attempt to set those secrets using the API.

jgonggrijp commented 2 years ago

The registration process for "Open Sauce" (which does what the name suggests) starts with an application form, which apparently will be reviewed by a real human. I should get a response within 48 hours.

ogonkov commented 2 years ago

Actions still didn't start, may be it should be kinda "approved" for a first time?

https://docs.github.com/en/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks#approving-workflow-runs-on-a-pull-request-from-a-public-fork

jgonggrijp commented 2 years ago

What I'm seeing is different from what is in that documentation page:

Don't worry though, I'm sure it will run once it's merged into master.

ogonkov commented 2 years ago

I think we could try to merge it then

jgonggrijp commented 2 years ago

I will, but I prefer setting up those secrets first. I still need to receive my account credentials from Sauce Labs.

jgonggrijp commented 2 years ago

@ogonkov I entered the secrets and merged your branch, but the workflow is still not kicking off. GitHub does recognize the workflow but somehow seems to think it doesn't need to run; see https://github.com/jashkenas/backbone/actions/workflows/tests.yml. Could the problem be in the branches: ${{ github.event.repository.default_branch }} lines?

ogonkov commented 2 years ago

It should not be a problem. I can try to change it to master, but i guess the problem is somewhere else.

ogonkov commented 2 years ago

Very interesting, my other workflow is started ok. I will dig it later, something wrong with my initial proposal.

ogonkov commented 2 years ago

Something weird with variables, they don't seem to interpolate properly. I didn't get the reason why it happen. Otherwise pipelines now works and tests are running (except Sause labs that use secrets and env variables)