Skip to content

Commit

Permalink
Use projen tasks (#29)
Browse files Browse the repository at this point in the history
* Use projen tasks

Ensure that it always installs dependencies with the same strategy.

Signed-off-by: David Calavera <[email protected]>

* Update node version for releases.

Signed-off-by: David Calavera <[email protected]>

* Update dependencies.

Signed-off-by: David Calavera <[email protected]>

---------

Signed-off-by: David Calavera <[email protected]>
  • Loading branch information
calavera authored Nov 12, 2023
1 parent 0a96e31 commit f44cc1a
Show file tree
Hide file tree
Showing 11 changed files with 697 additions and 874 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install NPM dependencies
run: yarn install --check-files
- name: Install dependencies
run: npx projen install:ci
- name: build
run: npx projen build
- name: Find mutations
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
- name: Prepare Repository
run: mv dist .repo
- name: Install Dependencies
run: cd .repo && yarn install --check-files --frozen-lockfile
run: cd .repo && npx projen install:ci
- name: Create js artifact
run: cd .repo && npx projen package:js
- name: Collect js Artifact
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
- name: Prepare Repository
run: mv dist .repo
- name: Install Dependencies
run: cd .repo && yarn install --check-files --frozen-lockfile
run: cd .repo && npx projen install:ci
- name: Create java artifact
run: cd .repo && npx projen package:java
- name: Collect java Artifact
Expand Down Expand Up @@ -181,7 +181,7 @@ jobs:
- name: Prepare Repository
run: mv dist .repo
- name: Install Dependencies
run: cd .repo && yarn install --check-files --frozen-lockfile
run: cd .repo && npx projen install:ci
- name: Create python artifact
run: cd .repo && npx projen package:python
- name: Collect python Artifact
Expand Down Expand Up @@ -209,7 +209,7 @@ jobs:
- name: Prepare Repository
run: mv dist .repo
- name: Install Dependencies
run: cd .repo && yarn install --check-files --frozen-lockfile
run: cd .repo && npx projen install:ci
- name: Create dotnet artifact
run: cd .repo && npx projen package:dotnet
- name: Collect dotnet Artifact
Expand Down Expand Up @@ -237,7 +237,7 @@ jobs:
- name: Prepare Repository
run: mv dist .repo
- name: Install Dependencies
run: cd .repo && yarn install --check-files --frozen-lockfile
run: cd .repo && npx projen install:ci
- name: Create go artifact
run: cd .repo && npx projen package:go
- name: Collect go Artifact
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
with:
python-version: '3.x'
- name: Install NPM dependencies
run: yarn install --check-files --frozen-lockfile
run: npx projen install:ci
- name: release
run: npx projen release
- name: Check for new commits
Expand All @@ -81,7 +81,7 @@ jobs:
steps:
- uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18.x
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
Expand All @@ -106,7 +106,7 @@ jobs:
steps:
- uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18.x
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
Expand All @@ -118,7 +118,7 @@ jobs:
- name: Prepare Repository
run: mv dist .repo
- name: Install Dependencies
run: cd .repo && yarn install --check-files --frozen-lockfile
run: cd .repo && npx projen install:ci
- name: Create js artifact
run: cd .repo && npx projen package:js
- name: Collect js Artifact
Expand All @@ -143,7 +143,7 @@ jobs:
java-version: '17.x'
- uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18.x
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
Expand All @@ -155,7 +155,7 @@ jobs:
- name: Prepare Repository
run: mv dist .repo
- name: Install Dependencies
run: cd .repo && yarn install --check-files --frozen-lockfile
run: cd .repo && npx projen install:ci
- name: Create java artifact
run: cd .repo && npx projen package:java
- name: Collect java Artifact
Expand All @@ -178,7 +178,7 @@ jobs:
steps:
- uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18.x
- uses: actions/setup-python@v4
with:
python-version: 3.x
Expand All @@ -193,7 +193,7 @@ jobs:
- name: Prepare Repository
run: mv dist .repo
- name: Install Dependencies
run: cd .repo && yarn install --check-files --frozen-lockfile
run: cd .repo && npx projen install:ci
- name: Create python artifact
run: cd .repo && npx projen package:python
- name: Collect python Artifact
Expand All @@ -213,7 +213,7 @@ jobs:
steps:
- uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18.x
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.x
Expand All @@ -228,7 +228,7 @@ jobs:
- name: Prepare Repository
run: mv dist .repo
- name: Install Dependencies
run: cd .repo && yarn install --check-files --frozen-lockfile
run: cd .repo && npx projen install:ci
- name: Create dotnet artifact
run: cd .repo && npx projen package:dotnet
- name: Collect dotnet Artifact
Expand All @@ -247,7 +247,7 @@ jobs:
steps:
- uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18.x
- uses: actions/setup-go@v3
with:
go-version: ^1.16.0
Expand All @@ -262,7 +262,7 @@ jobs:
- name: Prepare Repository
run: mv dist .repo
- name: Install Dependencies
run: cd .repo && yarn install --check-files --frozen-lockfile
run: cd .repo && npx projen install:ci
- name: Create go artifact
run: cd .repo && npx projen package:go
- name: Collect go Artifact
Expand Down
16 changes: 11 additions & 5 deletions .projen/deps.json

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

4 changes: 2 additions & 2 deletions .projen/tasks.json

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

7 changes: 7 additions & 0 deletions .projenrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ const project = new awscdk.AwsCdkConstructLibrary({
},
});

project.addDevDeps('aws-cdk-lib@^2');
project.addDevDeps('[email protected]');
project.addDevDeps('[email protected]');
project.addDevDeps('[email protected]');
project.addDevDeps('@types/node@^18');
project.addDevDeps('jest@^29');
project.addDevDeps('ts-jest@^29');
project.addBundledDeps('js-toml@^0.1.1');

project.addGitIgnore('target');
Expand Down
10 changes: 5 additions & 5 deletions API.md

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

12 changes: 6 additions & 6 deletions package.json

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

6 changes: 3 additions & 3 deletions test/bundlingOptions.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as path from 'path';
import { env } from 'process';
import { App, Stack } from 'aws-cdk-lib';
import { Template } from 'aws-cdk-lib/assertions';
import * as lambda from 'aws-cdk-lib/aws-lambda';
import * as cdk from 'aws-cdk-lib/core';
import { getManifestPath } from '../src/cargo';
import { RustFunction, RustFunctionProps, cargoLambdaVersion } from '../src/index';
import { bundlingOptionsFromRustFunctionProps } from '../src/util';
Expand Down Expand Up @@ -52,8 +52,8 @@ describe('bundlingOptionsFromRustFunctionProps', () => {
const forcedDockerBundling = !!env.FORCE_DOCKER_RUN || !cargoLambdaVersion();

const templateWithProps = (props?: RustFunctionProps) => {
const app = new cdk.App();
const stack = new cdk.Stack(app);
const app = new App();
const stack = new Stack(app);
const testSource = getManifestPath(path.join(__dirname, 'fixtures/single-package/Cargo.toml'));

new RustFunction(stack, 'arm-64-set-via-lambda-architecture', { manifestPath: testSource, ...props });
Expand Down
10 changes: 5 additions & 5 deletions test/extension.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { join } from 'path';
import { env } from 'process';
import * as cdk from 'aws-cdk-lib/core';
import { App, Stack } from 'aws-cdk-lib';
import { RustExtension, cargoLambdaVersion } from '../src/index';

const forcedDockerBundling = !!env.FORCE_DOCKER_RUN || !cargoLambdaVersion();

describe('CargoLambda.RustExtension', () => {
describe('With single package Cargo project', () => {
const app = new cdk.App();
const stack = new cdk.Stack(app);
const app = new App();
const stack = new Stack(app);
const testSource = join(__dirname, 'fixtures/single-package');

new RustExtension(stack, 'rust extension', {
Expand All @@ -24,8 +24,8 @@ describe('CargoLambda.RustExtension', () => {
});

describe('With a Cargo workspace', () => {
const app = new cdk.App();
const stack = new cdk.Stack(app);
const app = new App();
const stack = new Stack(app);
const testSource = join(__dirname, 'fixtures/cargo-workspace');

new RustExtension(stack, 'rust extension 1', {
Expand Down
Loading

0 comments on commit f44cc1a

Please sign in to comment.