Skip to content

Commit

Permalink
Merge branch 'meniole-development' into fix/bulk
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlementlegen committed Oct 9, 2024
2 parents c05f5de + 8f16193 commit 8c028e8
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"version": "0.2",
"ignorePaths": ["**/*.json", "**/*.css", "node_modules", "**/*.log", "**/tests/**"],
"ignorePaths": ["**/*.json", "**/*.css", "node_modules", "**/*.log", "**/tests/**", "dist/**"],
"useGitignore": true,
"language": "en",
"words": [
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ jobs:
git config --global user.email 'ubiquity-os[bot]@users.noreply.github.com'
git add -f ${{ github.workspace }}/dist/\*
if [ -n "$(git diff-index --cached --name-only HEAD)" ]; then
git pull
git commit -m "chore: updated dist" || echo "Lint-staged check failed"
git push origin HEAD:${{ github.ref_name }}
else
echo "No changes to commit"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36 changes: 4 additions & 32 deletions .github/workflows/compute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,37 +35,9 @@ jobs:
PERMIT_ERC20_TOKENS_NO_FEE_WHITELIST: ${{ secrets.PERMIT_ERC20_TOKENS_NO_FEE_WHITELIST }}

steps:
- name: Post starting comment to issue
uses: actions/github-script@v7
id: post-comment
with:
github-token: ${{ inputs.authToken }}
script: |
const comment_body = '\`\`\`diff\n+ Evaluating results. Please wait...';
const obj = ${{ inputs.eventPayload }}
if (obj.issue && "${{ inputs.eventName }}" === "issues.closed" && obj.issue.state_reason === "completed") {
const response = await github.rest.issues.createComment({
owner: obj.repository.owner.login,
repo: obj.repository.name,
issue_number: obj.issue.number,
body: comment_body,
});
core.setOutput('comment_id', response.data.id);
}
- name: Set environment variable
run: echo "COMMENT_ID=${{ steps.post-comment.outputs.comment_id }}" >> $GITHUB_ENV

- run: ${{ toJSON(inputs) }}
shell: cat {0}

- name: Checkout code
# Note: the checkout could potentially be avoided by calling the workflow on the repo/branch directly.
# However, this would mean that we would be unable to call it from the branch specified in ubiquity-os-config
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20.10.0"

- name: Generate Rewards
- name: Run compute rewards
uses: ./
4 changes: 3 additions & 1 deletion .github/workflows/formatting-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ jobs:
- name: Run formatting checks
run: |
yarn install
yarn format
yarn eslint --fix-dry-run --ignore-pattern dist/
yarn format:cspell
yarn prettier --check .
3 changes: 2 additions & 1 deletion .github/workflows/update-configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Install deps and run configuration update
run: |
yarn install --immutable --immutable-cache --check-cache
yarn tsc --noCheck --project tsconfig.json
yarn tsc --noCheck --project tsconfig.json -m commonjs
- name: Update manifest configuration using GitHub Script
uses: actions/github-script@v7
Expand Down Expand Up @@ -49,6 +49,7 @@ jobs:
git config --global user.email 'ubiquity-os[bot]@users.noreply.github.com'
git add ./manifest.json
if [ -n "$(git diff-index --cached --name-only HEAD)" ]; then
git pull
git commit -m "chore: updated generated configuration" || echo "Lint-staged check failed"
git push origin HEAD:${{ github.ref_name }}
else
Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ outputs:
description: "The result containing all the rewards of the users"
value: ${{ steps.main.outputs.result }}
runs:
using: 'node20'
main: 'dist/index.js'
using: "node20"
main: "dist/index.js"
3 changes: 3 additions & 0 deletions dist/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
8 changes: 6 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ export default tsEslint.config({
"@typescript-eslint": tsEslint.plugin,
"check-file": checkFile,
},
ignores: [".github/knip.ts"],
ignores: [".github/knip.ts", "dist/", "tests/__mocks__/**", "coverage/**"],
extends: [eslint.configs.recommended, ...tsEslint.configs.recommended, sonarjs.configs.recommended],
languageOptions: {
parser: tsEslint.parser,
parserOptions: {
project: ["./tsconfig.json"],
projectService: {
defaultProject: "tsconfig.json",
allowDefaultProject: ["*.mjs"],
},
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
Expand Down
2 changes: 1 addition & 1 deletion knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { KnipConfig } from "knip";
const config: KnipConfig = {
entry: ["src/index.ts"],
project: ["src/**/*.ts"],
ignore: ["src/data-collection/examples/*.ts", "src/configuration/common-config-type.ts"],
ignore: ["src/data-collection/examples/*.ts", "src/configuration/common-config-type.ts", "dist/**"],
ignoreExportsUsedInFile: true,
ignoreDependencies: ["ts-node", "msw", "@mswjs/data"],
jest: {
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,6 @@
/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
}
},
"exclude": ["dist/"]
}

0 comments on commit 8c028e8

Please sign in to comment.