final-space-api icon indicating copy to clipboard operation
final-space-api copied to clipboard

Add NodeJS CI Workflow

Open lelouchB opened this issue 5 years ago • 17 comments

Relies on #2 i.e. after Tests have been written.

Here is a possible

name: Node.js CI

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [8.x, 10.x, 12.x]

    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - run: npm install
    - run: npm run build --if-present
    - run: npm test
      env:
        CI: true

lelouchB avatar Oct 05 '20 11:10 lelouchB

I've worked with github actions/workflows before. Can I take this one after the tests are written?

trybick avatar Oct 06 '20 13:10 trybick

Ofcourse @trybick @JuanVqz is working on #2 In the meantime, I will assign this to you.

Thanks

lelouchB avatar Oct 06 '20 13:10 lelouchB

@trybick Would you like to work on the tests in frontend i.e. docusarus while backend tests are being made?

In this Workflow, we will add both these tests.

lelouchB avatar Oct 08 '20 05:10 lelouchB

I'm happy to do the workflow, but will pass on the tests, but thanks for the offer.

trybick avatar Oct 08 '20 11:10 trybick

Hey @trybick
backend tests are in progress, in the mean time Can you start on the frontend CI workflow that tests if the frontend build command i.e. npm run build is successful or not.

Let me know if you have any questions.

lelouchB avatar Oct 08 '20 14:10 lelouchB

Yes I can start on the workflow - I should be able to start it tonight or next night 👍

trybick avatar Oct 08 '20 14:10 trybick

Great 👍 here is a resource on this https://v2.docusaurus.io/docs/deployment/#using-azure-pipelines https://v2.docusaurus.io/docs/deployment/#triggering-deployment-with-travis-ci

P.S. no deploy command needed, only build

Thanks :)

lelouchB avatar Oct 08 '20 14:10 lelouchB

@lelouchB I am confused about those two links - the original issue at the top has an example of a github workflow to run the tests, right? I thought that would do it

trybick avatar Oct 08 '20 14:10 trybick

Yes, the issue is for tests but there are no tests for frontend so currently a workflow to check build will be really helpful. because of the issues related to frontend.

After the backend tests are done, workflow will be updated to accomodate them

Does this make sense? Let me know if you have any other questions

lelouchB avatar Oct 08 '20 14:10 lelouchB

Still a little confused - We want a workflow to run the tests but those are on hold until backend tests are done. In the mean time we want to a workflow to run the build command? Does it need to deploy anywhere - or just check that build is successful?

trybick avatar Oct 08 '20 14:10 trybick

Still a little confused - We want a workflow to run the tests but those are on hold until backend tests are done. In the mean time we want to a workflow to run the build command? Does it need to deploy anywhere - or just check that build is successful?

Yes that's correct.

I am fine with build only but if you want you can add deploy command too. It can be helpful to see actual changes. What do you think?

lelouchB avatar Oct 08 '20 14:10 lelouchB

Ok, just to confirm, the build workflow would just confirm the build is successful and then exit right? If we wanted to deploy too I think that would involve a lot more

trybick avatar Oct 08 '20 14:10 trybick

Ok, just to confirm, the build workflow would just confirm the build is successful and then exit right? If we wanted to deploy too I think that would involve a lot more

Yes, it will tell if the build is successful and then exit. yep, the deployment preview will involve a lot more so we can take it step by step. build is a priority right now so we should proceed with it first.

Thanks

lelouchB avatar Oct 08 '20 14:10 lelouchB

Ok, thanks for clarifying!

trybick avatar Oct 08 '20 14:10 trybick

Hey @trybick Lint script has been added to backend, do you think you an add it to workflow?

Thanks

lelouchB avatar Oct 09 '20 09:10 lelouchB

Hey @lelouchB sure! Would that be a new workflow to just run the lint command in the backend?

I also was thinking, would you want a pre-commit hook added? - so every time someone commits it lints and prettifies the code - an option if you want to consider :)

trybick avatar Oct 09 '20 11:10 trybick

Hey @lelouchB sure! Would that be a new workflow to just run the lint command in the backend?

I also was thinking, would you want a pre-commit hook added? - so every time someone commits it lints and prettifies the code - an option if you want to consider :)

Yes yes that pre commit hook would be amazing too.

lelouchB avatar Oct 09 '20 11:10 lelouchB