Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom scripts #21

Open
kristian240 opened this issue Jul 13, 2023 · 2 comments
Open

Custom scripts #21

kristian240 opened this issue Jul 13, 2023 · 2 comments

Comments

@kristian240
Copy link
Contributor

Right now build, lint, test, ... commands are running corresponding npm scripts. However, it might be useful if we can add a possibility to override a specific command with a custom one.

Scenario

I want to have two scripts for testing - one that I use for development and one that is being used on CI.

Current

I have 2 scripts - test for CI and test:coverage for dev. The DX is not great since I need to adapt my workflow because we do not want to trigger a test run with coverage on our app to improve the speed. So now, everytime I want to run the tests locally and I want to checkout the coverage I need to run npm run test:coverage or yarn test:coverage.

Workaround

I could check which environment I'm using and then make 3 scripts - test, test:ci and test:coverage. Then the test script would be basically ifCi ? testCi() : testCoverage(). Then I can run npm run test both on ci and local and the DX is improved.

Solution

If we allow the custom scripts to be passed in to actions then this problem could be solved once in much easier way. Two scripts - test for dev and test:ci for CI.

API

jobs:
  test-analyze:
    name: 'Run'
    uses: infinum/js-pipeline/.github/workflows/pipeline.yml@v2
    with:
      ci_steps: 'lint test analyze'
      workflow: '.github/workflows/pr.yml'
      test: npm run test:ci # custom test command
      build: npm run build:ci # custom build command

Maybe the entire issue is just nitpicking but I can see how this can solve potential issues in the future.

If you think this is a good idea, I would love to implement the changes myself :D

@kristian240
Copy link
Contributor Author

cc: @DarkoKukovec @danipavic

@danipavic
Copy link
Contributor

I had a similar issue before but we never followed up on it. I agree that this will improve DX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants