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

feature/test lint #23

Merged
merged 13 commits into from
Apr 28, 2023
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
50 changes: 46 additions & 4 deletions .github/workflows/lint-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,50 @@ jobs:
steps:
- name: Check out repository code
uses: actions/checkout@v3
- run: npm ci
- run: cp .env.dist .env
- run: npm run build
- run: npm run lint
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Install dependencies
run: npm ci
- name: Copy env file
run: cp .env.dist .env
- name: Run ESLint
run: npm run lint
#- name: Annotate Pull Request
# uses: actions/github-script@v3
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# script: |
# const fs = require('fs');
# const report = fs.readFileSync('eslint-report.json', 'utf-8');
# const annotations = JSON.parse(report).map((error) => ({
# path: error.filePath,
# start_line: error.line,
# end_line: error.line,
# annotation_level: 'failure',
# message: error.message,
# }));
# console.log(annotations);
# const octokit = require('@octokit/rest')();
# octokit.authenticate({
# type: 'token',
# token: process.env.GITHUB_TOKEN,
# });
# for (const annotation of annotations) {
# const res = await octokit.checks.create({
# owner: context.repo.owner,
# repo: context.repo.repo,
# name: 'ESLint Check',
# head_sha: context.payload.pull_request.head.sha,
# conclusion: 'failure',
# output: {
# title: 'ESLint Errors',
# summary: `ESLint found ${annotations.length} errors in your code`,
# annotations: [annotation],
# },
# });
# }
- name: Run build
run: npm run build
#- run: npm run test
23 changes: 15 additions & 8 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
name: Pull request

on:
pull_request:

permissions:
contents: write
id-token: write
checks: write

jobs:
lint-client:
uses: ./.github/workflows/lint-client.yml
lint-utils:
uses: ./.github/workflows/lint-utils.yml
lint-users:
uses: ./.github/workflows/lint-users.yml
lint-notes:
uses: ./.github/workflows/lint-notes.yml
lint-posts:
uses: ./.github/workflows/lint-posts.yml
#lint-utils:
# uses: ./.github/workflows/lint-utils.yml
#lint-users:
# uses: ./.github/workflows/lint-users.yml
#lint-notes:
# uses: ./.github/workflows/lint-notes.yml
#lint-posts:
# uses: ./.github/workflows/lint-posts.yml
Loading