Skip to content

Commit

Permalink
feat(rust): add support for projen and upgrade workflows in rust proj…
Browse files Browse the repository at this point in the history
…ects (#110)

* feat(rust): add support for projen and upgrade workflows in rust projects

* chore: self mutation

Signed-off-by: github-actions <github-actions@github.com>

---------

Signed-off-by: github-actions <github-actions@github.com>
Co-authored-by: github-actions <github-actions@github.com>
  • Loading branch information
gplassard and github-actions committed May 5, 2024
1 parent ae0ca07 commit 34568f7
Show file tree
Hide file tree
Showing 2 changed files with 222 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/rust/RustProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ import { Cargo, CargoProps } from './Cargo';
import { RustLintAction, RustLintActionProps } from './RustLintAction';
import { RustReleaseActions, RustReleaseActionsProps } from './RustReleaseActions';
import { CustomGitignore, CustomGitignoreProps } from '../git';
import { NodeJSDependenciesUpgradeAction, NodeJSDependenciesUpgradeActionProps, ProjenSynthAction, ProjenSynthActionProps } from '../github';
import { DEFAULT_PULL_REQUEST_LINT_OPTIONS } from '../github/utils';

export interface RustProjectOptions extends ProjectOptions {
cargo: CargoProps;
customGitignore?: CustomGitignoreProps;
nodeJSDependenciesUpgradeAction?: boolean;
nodeJSDependenciesUpgradeActionOptions?: NodeJSDependenciesUpgradeActionProps;
projenSynthAction?: boolean;
projenSynthActionOptions?: ProjenSynthActionProps;
rustReleaseActions?: RustReleaseActionsProps;
rustLintActions?: RustLintActionProps;
}
Expand All @@ -33,10 +38,12 @@ export class RustProject extends Project {
new Cargo(this, options.cargo);
new RustReleaseActions(this, options.rustReleaseActions);
new RustLintAction(this, options.rustLintActions);
new GitHub(this, {
const github = new GitHub(this, {
mergify: false,
pullRequestLintOptions: DEFAULT_PULL_REQUEST_LINT_OPTIONS,
});

(options.nodeJSDependenciesUpgradeAction || options.nodeJSDependenciesUpgradeAction == undefined)
&& new NodeJSDependenciesUpgradeAction(github, options.nodeJSDependenciesUpgradeActionOptions ?? {});
(options.projenSynthAction || options.projenSynthAction == undefined) && new ProjenSynthAction(github, options.projenSynthActionOptions ?? {});
}
}
213 changes: 213 additions & 0 deletions test/rust/__snapshots__/RustProject.test.ts.snap

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

0 comments on commit 34568f7

Please sign in to comment.