fudgebucket27 / Lexplorer

Loopring explorer alternative
14 stars 10 forks source link

Adding tests to checks for PR #165

Closed daniel-soli closed 2 years ago

daniel-soli commented 2 years ago

With adding a simple add job step to the workflows:

- name: Test .NET project
        run: dotnet test
        working-directory: ${{ env.TEST_DIRECTORY }}

we can get these test running before a PR is done, and directly see if we have broken something.. Like this: image

Would also need to split up CI/CD in seperate workflows.

modersohn commented 2 years ago

Now I see how this is different from separate workflows, e.g. in my fork.

So I get the general idea, but please try to explain what needs to be changed in more detail, especially with regards to the two existing workflows that are already in place here.

daniel-soli commented 2 years ago

I'm not always the best in explaining 😄
Take a look at my workflows in LoopStats. Splitting CI and CD into two different workflows, basically beeing as is but adding the necessary formatting to both. So instead of 2 workflows as it is now, it would be 4. CI and CD for dev, CI and CD for prod.

modersohn commented 2 years ago

Oh well, seems I've got some digging to do.

I assume the modified workflows are only active once they've been merged into master, correct?

And the CI part could be the same for everything, i.e. including PRs, correct?

daniel-soli commented 2 years ago

Yeah, that's a drawback... Can only test while in the environments. But could do dev first to see if all works as expected, and then just copy to prod workflows

modersohn commented 2 years ago

To save me from editing the workflow actions that fudgey did back then, I just added a new specific workflow that is only triggered by pull requests on master and dev. Let's see if that is sufficient!

modersohn commented 2 years ago

Oh well, first trial with #168 and the workflow wasn't triggered. No idea why, isn't it sufficient to have the workflow committed in master?

modersohn commented 2 years ago

OK, merging master back into dev (#169) did the trick:

image