Skip to content

Commit

Permalink
Replace some workflow tests with Node test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo98 committed May 22, 2024
1 parent 677db44 commit bbf4cf4
Show file tree
Hide file tree
Showing 39 changed files with 896 additions and 170 deletions.
4 changes: 4 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ignore:
- "spec-helper.mjs"
- "test-reporter.mjs"
- "**/*.test.mjs"
32 changes: 0 additions & 32 deletions .github/workflows/check-commit-format.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/dismiss-approvals.yml

This file was deleted.

50 changes: 0 additions & 50 deletions .github/workflows/label-pull-requests.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/post-comment.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Node test

on:
push:
branches:
- master
pull_request:

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Run tests
run: npm test -- --experimental-test-coverage --test-reporter lcov --test-reporter-destination lcov.info

- name: Upload coverage results
uses: codecov/codecov-action@125fc84a9a348dbcf27191600683ec096ec9021c # v4.4.1
with:
files: lcov.info
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}
1 change: 0 additions & 1 deletion .tool-versions

This file was deleted.

2 changes: 1 addition & 1 deletion check-commit-format/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ inputs:
default: CI-published-bottle-commits
runs:
using: node20
main: main.js
main: main.mjs
14 changes: 7 additions & 7 deletions check-commit-format/main.js → check-commit-format/main.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const core = require('@actions/core')
const github = require('@actions/github')
const fs = require('fs')
const path = require('path')
import core from "@actions/core"
import github from "@actions/github"
import fs from "fs"
import path from "path"

async function main() {
try {
Expand Down Expand Up @@ -37,7 +37,7 @@ async function main() {
ref: commit.sha
})

short_sha = commit.sha.substring(0, 10);
const short_sha = commit.sha.substring(0, 10);

// Autosquash doesn't support merge commits.
if (commit_info.data.parents.length != 1) {
Expand Down Expand Up @@ -167,8 +167,8 @@ async function main() {
labels: updatedLabels
})
} catch (error) {
core.setFailed(error.message)
core.setFailed(error)

Check warning on line 170 in check-commit-format/main.mjs

View check run for this annotation

Codecov / codecov/patch

check-commit-format/main.mjs#L170

Added line #L170 was not covered by tests
}
}

main()
await main()
Loading

0 comments on commit bbf4cf4

Please sign in to comment.