Skip to content

Commit

Permalink
Merge pull request #74 from mtsmfm/fixci
Browse files Browse the repository at this point in the history
Tweak CI
  • Loading branch information
mtsmfm authored Apr 24, 2023
2 parents 812a40a + 9033066 commit 47feda9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG USER_GID=$USER_UID

RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& curl -fsSL https://deb.nodesource.com/setup_14.x | bash - \
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get update \
&& apt-get install -y sudo nodejs \
&& npm install -g yarn \
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,21 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { issue: { number: issue_number }, repo: { owner, repo } } = context;
const { data: comments } = await github.rest.issues.listComments({ owner, repo, issue_number });
const existingComment = comments.find(comment => comment.user.login === "github-actions[bot]" && comment.body.includes("Benchmark result: ${{ matrix.name }}"))
const { execSync } = require("child_process");
const result = execSync("bin/benchmark");
const body = `
${{ matrix.name }} (${{ matrix.ref }})
Benchmark result: ${{ matrix.name }} (${{ matrix.ref }})
\`\`\`
${result}
\`\`\`
`;
const { issue: { number: issue_number }, repo: { owner, repo } } = context;
github.rest.issues.createComment({ issue_number, owner, repo, body });
if (existingComment) {
github.rest.issues.updateComment({ owner, repo, body, comment_id: existingComment.id });
} else {
github.rest.issues.createComment({ owner, repo, body, issue_number });
}
4 changes: 2 additions & 2 deletions .github/workflows/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
with:
ref: ${{ github.head_ref }}
- id: commit_author
run: echo "::set-output name=author::$(git show -s --format=%an)"
run: echo "name=author::$(git show -s --format=%an)" >> $GITHUB_OUTPUT

generator:
needs: get_latest_commit_author
Expand All @@ -33,7 +33,7 @@ jobs:
bundler-cache: true
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
- run: bin/generate_files
- run: git diff --exit-code
- if: failure()
Expand Down

0 comments on commit 47feda9

Please sign in to comment.