Add biome and initial format rules

This commit is contained in:
Nick Cipollo
2025-02-17 16:15:54 -05:00
parent 33bf18d283
commit 17b559883e
37 changed files with 3110 additions and 975 deletions

View File

@@ -1,18 +1,18 @@
import {Action} from "../src/Action";
import * as github from "@actions/github";
import {Inputs} from "../src/Inputs";
import {GithubReleases, ReleaseData} from "../src/Releases";
import {GithubArtifactUploader} from "../src/ArtifactUploader";
import * as path from "path";
import {FileArtifactGlobber} from "../src/ArtifactGlobber";
import {Outputs} from "../src/Outputs";
import {GithubArtifactDestroyer} from "../src/ArtifactDestroyer";
import {ReleaseActionSkipper} from "../src/ActionSkipper";
import { Action } from "../src/Action"
import * as github from "@actions/github"
import { Inputs } from "../src/Inputs"
import { GithubReleases, ReleaseData } from "../src/Releases"
import { GithubArtifactUploader } from "../src/ArtifactUploader"
import * as path from "path"
import { FileArtifactGlobber } from "../src/ArtifactGlobber"
import { Outputs } from "../src/Outputs"
import { GithubArtifactDestroyer } from "../src/ArtifactDestroyer"
import { ReleaseActionSkipper } from "../src/ActionSkipper"
// This test is currently intended to be manually run during development. To run:
// - Make sure you have an environment variable named GITHUB_TOKEN assigned to your token
// - Remove skip from the test below
describe.skip('Integration Test', () => {
describe.skip("Integration Test", () => {
let action: Action
beforeEach(() => {
@@ -22,18 +22,14 @@ describe.skip('Integration Test', () => {
const inputs = getInputs()
const outputs = getOutputs()
const releases = new GithubReleases(inputs, git)
const uploader = new GithubArtifactUploader(
releases,
inputs.replacesArtifacts,
inputs.artifactErrorsFailBuild,
)
const uploader = new GithubArtifactUploader(releases, inputs.replacesArtifacts, inputs.artifactErrorsFailBuild)
const artifactDestroyer = new GithubArtifactDestroyer(releases)
const actionSkipper = new ReleaseActionSkipper(inputs.skipIfReleaseExists, releases, inputs.tag)
action = new Action(inputs, outputs, releases, uploader, artifactDestroyer, actionSkipper)
})
it('Performs action', async () => {
it("Performs action", async () => {
await action.perform()
})
@@ -47,7 +43,7 @@ describe.skip('Integration Test', () => {
createdReleaseBody: "This release was generated by release-action's integration test",
createdReleaseName: "Releases Action Integration Test",
commit: undefined,
discussionCategory: 'Release',
discussionCategory: "Release",
generateReleaseNotes: true,
owner: "ncipollo",
createdPrerelease: false,
@@ -61,10 +57,10 @@ describe.skip('Integration Test', () => {
updatedReleaseBody: "This release was updated by release-action's integration test",
updatedReleaseName: "Releases Action Integration Test",
updatedPrerelease: false,
updateOnlyUnreleased: false
updateOnlyUnreleased: false,
}
})
return new MockInputs();
return new MockInputs()
}
function getOutputs(): Outputs {
@@ -72,7 +68,7 @@ describe.skip('Integration Test', () => {
return {
applyReleaseData(releaseData: ReleaseData) {
console.log(`Release Data: ${releaseData}`)
}
},
}
})
return new MockOutputs()
@@ -80,7 +76,7 @@ describe.skip('Integration Test', () => {
function artifacts() {
const globber = new FileArtifactGlobber()
const artifactPath = path.join(__dirname, 'Integration.test.ts')
const artifactPath = path.join(__dirname, "Integration.test.ts")
const artifactString = `~/Desktop,~/Desktop/test.txt,blarg.tx, ${artifactPath}`
return globber.globArtifactString(artifactString, "raw", false)
}
@@ -88,5 +84,4 @@ describe.skip('Integration Test', () => {
function getToken(): string {
return process.env.GITHUB_TOKEN ?? ""
}
})