Skip to content

ci: ci update of all workflows #822

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

Merged
merged 4 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
748 changes: 748 additions & 0 deletions .github/CONTRIBUTING.md

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions .github/TROUBLESHOOT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# TROUBLESHOOT

## Development

### Limit of file watchers reached

Error: ENOSPC: System limit for number of file watchers reached
[Stackoverflow answer](https://stackoverflow.com/questions/55763428/react-native-error-enospc-system-limit-for-number-of-file-watchers-reached)

```
# insert the new value into the system config
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

# check that the new value was applied
cat /proc/sys/fs/inotify/max_user_watches

# config variable name (not runnable)
fs.inotify.max_user_watches=524288
```
92 changes: 92 additions & 0 deletions .github/commit-convention.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
## Git Commit Message Convention

> This is adapted from [Angular's commit convention](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular).

#### TL;DR:

Messages must be matched by the following regex:

<!-- prettier-ignore -->
```js
/^(revert: )?(feat|fix|docs|dx|refactor|perf|test|workflow|build|ci|chore|types|wip|release|deps)(\(.+\))?: .{1,50}/
```

#### Examples

Appears under "Features" header, `dev` subheader:

```
feat(dev): add 'comments' option
```

Appears under "Bug Fixes" header, `dev` subheader, with a link to issue #28:

```
fix(dev): fix dev error

close #28
```

Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation:

```
perf(build): remove 'foo' option

BREAKING CHANGE: The 'foo' option has been removed.
```

The following commit and commit `667ecc1` do not appear in the changelog if they are under the same release. If not, the revert commit appears under the "Reverts" header.

```
revert: feat(compiler): add 'comments' option

This reverts commit 667ecc1654a317a13331b17617d973392f415f02.
```

### Full Message Format

A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**:

```
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```

The **header** is mandatory and the **scope** of the header is optional.

### Revert

If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body, it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.

### Type

If the prefix is `feat`, `fix` or `perf`, it will appear in the changelog. However, if there is any [BREAKING CHANGE](#footer), the commit will always appear in the changelog.

Other prefixes are up to your discretion. Suggested prefixes are `docs`, `chore`, `style`, `refactor`, and `test` for non-changelog related tasks.

### Scope

The scope could be anything specifying the place of the commit change. For example `dev`, `build`, `workflow`, `cli` etc...

### Subject

The subject contains a succinct description of the change:

- use the imperative, present tense: "change" not "changed" nor "changes"
- don't capitalize the first letter
- no dot (.) at the end

### Body

Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
The body should include the motivation for the change and contrast this with previous behavior.

### Footer

The footer should contain any information about **Breaking Changes** and is also the place to
reference GitHub issues that this commit **Closes**.

**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
15 changes: 13 additions & 2 deletions .github/file-filters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,29 @@
frontend_lintable:
- "**/*.[tj]{s,sx}"
- "**/tsconfig*.json"
- "**/package.json"
- "pnpm-lock.yaml"

package_json_lintable:
- "**/package.json"
- "package.json"

markdown_lintable:
- "**/*.md"
- "**/*.mdx"
- "**/package.json"
- "pnpm-lock.yaml"

yaml_lintable:
- "**/*.yml"
- "**/*.yaml"
- "pnpm-lock.yaml"

packages: &packages
- "**/tsconfig*.json"
- "pnpm-lock.yaml"
- "package.json"
- "packages/**"
- ".github/workflows/test.yml"
- ".github/workflows/lint.yml"

codecov:
- "codecov.yml"
30 changes: 30 additions & 0 deletions .github/ignore-files-for-nx-affected.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.github/**
plop/**
.husky/**
.nx/**
.czrc
.editorconfig
.gitattributes
.gitignore
.lintstagedrc.cjs
.lintstagedrc.cjs
.npmignore
.nxignore
.prettierignore
.prettierrc.cjs
.secretlintignore
.secretlintrc.cjs
.textlintignore
.textlintrc
.yamllint.yaml
audit-ci.jsonc
codecov.yml
commitlint.config.cjs
nx.json
plop.js
pnpm-lock.yaml
pnpm-workspace.yaml
taze.config.js
tsconfig.base.json
tsconfig.eslint.json
tsconfig.json
34 changes: 34 additions & 0 deletions .github/workflows/allo-allo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "AlloAllo"

on: # yamllint disable-line rule:truthy
issues:
types:
- "opened"
pull_request_target:
branches:
- "main"
types:
- "opened"
- "closed"

jobs:
allo-allo:
uses: "anolilab/workflows/.github/workflows/allo-allo.yml@main"
with:
target-repo: "anolilab/javascript-style-guide"
issue-welcome: >
It looks like this is your first issue. Welcome! 👋
One of the project maintainers will be with you as soon as possible. We
appreciate your patience. To safeguard the health of the project, please
take a moment to read our [code of conduct](https://github.com/anolilab/javascript-style-guide/blob/main/.github/CODE_OF_CONDUCT.md).
pr-welcome: >
It looks like this is your first pull request. 🎉
Thank you for your contribution! One of the project maintainers will triage
and assign the pull request for review. We appreciate your patience. To
safeguard the health of the project, please take a moment to read our
[code of conduct](https://github.com/anolilab/javascript-style-guide/blob/main/.github/CODE_OF_CONDUCT.md).
pr-merged: >
Congratulations on your first merged pull request! 🎉
Thank you for your contribution!
We appreciate your patience.
We look forward to your next contribution.
37 changes: 5 additions & 32 deletions .github/workflows/cache-clear.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,12 @@
name: "cleanup caches by a branch"
name: "Cleanup caches by a branch"

on: # yamllint disable-line rule:truthy
pull_request:
types:
- "closed"

jobs:
cleanup:
runs-on: "ubuntu-latest"
steps:
- name: "Harden Runner"
uses: "step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142" # v2.7.0
with:
egress-policy: "audit"

- name: "Check out code"
uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1

- name: "Cleanup"
run: |
gh extension install actions/gh-actions-cache

REPO=${{ github.repository }}
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"

echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )

## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
cleanup-branch-cache:
uses: "anolilab/workflows/.github/workflows/cleanup-branch-cache.yml@main"
with:
target-repo: "anolilab/javascript-style-guide"
10 changes: 5 additions & 5 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ jobs:

steps:
- name: "Harden Runner"
uses: "step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142" # v2.7.0
uses: "step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6" # v2.8.1
with:
egress-policy: "audit"

- name: "Checkout repository"
uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1
uses: "actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332" # v4.1.7

# Initializes the CodeQL tools for scanning.
- name: "Initialize CodeQL"
uses: "github/codeql-action/init@928ff8c822d966a999092a6a35e32177899afb7c" # v2.24.6
uses: "github/codeql-action/init@1b1aada464948af03b950897e5eb522f92603cc2" # v3.24.9
with:
languages: "${{ matrix.language }}"
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -62,7 +62,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: "Autobuild"
uses: "github/codeql-action/autobuild@928ff8c822d966a999092a6a35e32177899afb7c" # v2.24.6
uses: "github/codeql-action/autobuild@1b1aada464948af03b950897e5eb522f92603cc2" # v3.24.9

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -75,6 +75,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: "Perform CodeQL Analysis"
uses: "github/codeql-action/analyze@928ff8c822d966a999092a6a35e32177899afb7c" # v2.24.6
uses: "github/codeql-action/analyze@1b1aada464948af03b950897e5eb522f92603cc2" # v3.24.9
with:
category: "/language:${{matrix.language}}"
68 changes: 68 additions & 0 deletions .github/workflows/comment-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: "Comment Issue"

on: # yamllint disable-line rule:truthy
issues:
types:
- "labeled"

permissions:
contents: "read"

jobs:
add-comment-for-user-interest:
if: "github.event.label.name == 's: waiting for user interest'"
runs-on: "ubuntu-latest"
permissions:
issues: "write"
steps:
- name: "Harden Runner"
uses: "step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6" # v2.8.1
with:
egress-policy: "audit"

- name: "Add Comment For User Interest"
uses: "actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea" # v7.0.1
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `**Thank you for your feature proposal.**

We marked it as "waiting for user interest" for now to gather some feedback from our community:

- If you would like to see this feature be implemented, please react to the description with an up-vote (:+1:).
- If you have a suggestion or want to point out some special cases that need to be considered, please leave a comment, so we are aware about them.

We would also like to hear about other community members' use cases for the feature to give us a better understanding of their potential implicit or explicit requirements.

We will start the implementation based on:

- the number of votes (:+1:) and comments
- the relevance for the ecosystem
- availability of alternatives and workarounds
- and the complexity of the requested feature

We do this because:

- There are plenty of frameworks/tools out there and we would like to ensure that every method can cover all or almost all of them.
- Every feature we add to Visulima has "costs" associated to it:
- initial costs: design, implementation, reviews, documentation
- running costs: awareness of the feature itself, more complex module structure, increased bundle size, more work during refactors

---

[View more issues which are waiting for user interest](https://github.com/anolilab/javascript-style-guide/issues?q=is%3Aissue+is%3Aopen+label%3A%22s%3A+waiting+for+user+interest%22+)`,
})

- name: "React to Issue"
uses: "actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea" # v7.0.1
with:
script: |
github.rest.reactions.createForIssue({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
content: "+1",
});
7 changes: 4 additions & 3 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ name: "Dependency Review"
on: # yamllint disable-line rule:truthy
# eslint-disable-next-line yml/no-empty-mapping-value
pull_request: # yamllint disable-line rule:empty-values
merge_group: # yamllint disable-line rule:empty-values

permissions:
contents: "read"
Expand All @@ -20,16 +21,16 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: "Harden Runner"
uses: "step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142" # v2.7.0
uses: "step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6" # v2.8.1
with:
egress-policy: "audit"

- name: "Git checkout"
uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1
uses: "actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332" # v4.1.7
env:
GIT_COMMITTER_NAME: "GitHub Actions Shell"
GIT_AUTHOR_NAME: "GitHub Actions Shell"
EMAIL: "github-actions[bot]@users.noreply.github.com"

- name: "Dependency Review"
uses: "actions/dependency-review-action@9129d7d40b8c12c1ed0f60400d00c92d437adcce" # v4.1.3
uses: "actions/dependency-review-action@72eb03d02c7872a771aacd928f3123ac62ad6d3a" # v4.3.3
Loading
Loading