lelouchB / final-space-api

Final Space API : RESTful API based on the show Final Space.
https://finalspaceapi.com
BSD 3-Clause "New" or "Revised" License
79 stars 47 forks source link

Add NodeJS CI Workflow #5

Open lelouchB opened 3 years ago

lelouchB commented 3 years ago

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
trybick commented 3 years ago

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

lelouchB commented 3 years ago

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

Thanks

lelouchB commented 3 years ago

@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.

trybick commented 3 years ago

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

lelouchB commented 3 years ago

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.

trybick commented 3 years ago

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

lelouchB commented 3 years ago

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 :)

trybick commented 3 years ago

@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

lelouchB commented 3 years ago

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

trybick commented 3 years ago

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?

lelouchB commented 3 years ago

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?

trybick commented 3 years ago

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

lelouchB commented 3 years ago

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

trybick commented 3 years ago

Ok, thanks for clarifying!

lelouchB commented 3 years ago

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

Thanks

trybick commented 3 years ago

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 :)

lelouchB commented 3 years ago

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.