Skip to content

Commit

Permalink
PLA-289 Add a test workflow for rust projects
Browse files Browse the repository at this point in the history
  • Loading branch information
quesabe committed Jan 5, 2024
1 parent 55d11df commit 59c79da
Show file tree
Hide file tree
Showing 9 changed files with 1,264 additions and 2 deletions.
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
],
"words": [
"cicd",
"clippy",
"dangerules",
"devs",
"estree",
Expand Down
48 changes: 48 additions & 0 deletions src/cdk/__tests__/__snapshots__/index.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions src/cdk/__tests__/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,21 @@ describe('CDK template', () => {
})
})

describe('has rust test workflow', () => {
test('excluded by default', () => {
const project = new TestCDKProject()
const snapshot = synthSnapshot(project)
expect(snapshot['.github/workflows/rust-test.yml']).not.toBeDefined()
})

test('included with an option', () => {
const project = new TestCDKProject({hasRustTestWorkflow: true})
const snapshot = synthSnapshot(project)
expect(snapshot['.github/workflows/rust-test.yml']).toBeDefined()
expect(snapshot['.github/workflows/rust-test.yml']).toMatchSnapshot()
})
})

describe('GraphQL', () => {
test('is disabled by default', () => {
const project = new TestCDKProject()
Expand Down
12 changes: 11 additions & 1 deletion src/cdk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,22 @@ import {AwsCdkTypeScriptApp, AwsCdkTypeScriptAppOptions} from 'projen/lib/awscdk
import {NodePackageManager} from 'projen/lib/javascript'
import {AssetFile} from '../common'
import {WithGitHooks, addHusky, extendGitignore} from '../common/git'
import {ProjenDriftCheckWorkflow, PullRequestTest, ReleaseWorkflow, WithDefaultWorkflow} from '../common/github'
import {
ProjenDriftCheckWorkflow,
PullRequestTest,
ReleaseWorkflow,
RustTestWorkflow,
WithDefaultWorkflow,
WithRustTestWorkflow,
} from '../common/github'
import {WithCustomLintPaths, addLinters} from '../common/lint'
import {IWithTelemetryReportUrl, WithTelemetry, collectTelemetry, setupTelemetry} from '../common/telemetry'
import {addVsCode} from '../common/vscode-settings'

export interface OttofellerCDKProjectOptions
extends AwsCdkTypeScriptAppOptions,
WithDefaultWorkflow,
WithRustTestWorkflow,
WithCustomLintPaths,
WithGitHooks,
WithTelemetry {
Expand Down Expand Up @@ -130,6 +138,8 @@ export class OttofellerCDKProject extends AwsCdkTypeScriptApp implements IWithTe
ProjenDriftCheckWorkflow.addToProject(this, options)
}

RustTestWorkflow.addToProject(this, options)

// ANCHOR Set up GraphQL
const isGraphqlCodegenEnabled = options.isGraphqlCodegenEnabled ?? false

Expand Down
Loading

0 comments on commit 59c79da

Please sign in to comment.