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

feat: 74 Added basic tests and linting workflows #88

Merged
merged 3 commits into from
Feb 2, 2024

Conversation

BallardRobinett
Copy link
Contributor

@BallardRobinett BallardRobinett commented Jan 16, 2024

#74

Added some workflows to automatically run codeql, trivy, owasp, sonarcloud, and precommit code. Tried to keep it consistent with cas-registration repo.

This repo is lacking in actual code at the moment, so most of the scans won't be doing much yet.

More reusable github actions available in this button repo: https://github.com/button-inc/gh-actions/tree/develop

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

# The branches below must be a subset of the branches above
branches: [main, develop]
schedule:
- cron: "19 23 * * 5"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Crontab guru tells me this is "run every Friday at 23:19" any reason why? We can remove it otherwise

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just saw that cas-registration was running it daily, but yeah I think it would be fine just on push and PR

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use node 20 now

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
node-version: 16
node-version: 20

path: ~/.cache/trivy
key: callee-trivy-${{ github.workflow }}-${{ github.run_id }}
restore-keys: trivy-
- name: Run Trivy vulnerability scanner in repo mode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to scan the container too, once it's available. I'll write a card for it

- name: Build and start server
run: |
npx ${{ inputs.package-manager }} run build
npx ${{ inputs.package-manager }} run start & # This starts the server in the background
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This likely this will try to run npx yarn run start & from the base directory, which will fail.
We can pass a default value for this entire job: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_iddefaultsrun

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this wants to have working directory set to ./client, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!

@pbastia
Copy link
Contributor

pbastia commented Jan 30, 2024

Will need a rebase too

@BallardRobinett BallardRobinett force-pushed the 74-create-github-actions branch from b342240 to 972d79a Compare February 1, 2024 18:06
Copy link
Contributor

@pbastia pbastia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! One comment left on codeQL

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 more things!

Copy link
Contributor

@pbastia pbastia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@pbastia pbastia merged commit 5713975 into develop Feb 2, 2024
4 of 5 checks passed
@pbastia pbastia deleted the 74-create-github-actions branch February 2, 2024 17:10
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

Successfully merging this pull request may close these issues.

2 participants