Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ci workflow #3

Merged
merged 8 commits into from
Sep 24, 2024
Merged

Add ci workflow #3

merged 8 commits into from
Sep 24, 2024

Conversation

smiasojed
Copy link
Collaborator

Add CI workflow with some tests

Copy link
Member

@xermicus xermicus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a bunch of nits

},
},
},
};

describe('Express Server', function () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could explain what the test actually does on a higher level?

@@ -1,8 +1,70 @@
import request from 'supertest';
import { expect } from 'chai';
import app from '../server.js';
import config from '../config/config.js';

//Compiler input
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove or make the comment meaningful instead

});
});

// Add more tests with the shorter timeout here
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment? Or is this a todo?

sources: {
'MyContract.sol': {
content: `
// SPDX-License-Identifier: GPL-3.0
Copy link
Member

@xermicus xermicus Sep 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a bad idea (unless we want to GPL license the whole thing which I doubt?). Not sure if it would hold up legally though as it's just a test fixture.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is just fixture, but I can change it, which license would you like to have?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IANAL but for the fixture either UNLICENSED or whatever this repository license is going sounds like an appropriate choice to me?

@@ -22,6 +22,7 @@ WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY utils/ ./utils
COPY config/ ./config
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All those copies can just be COPY . . with a correct .dockerignore instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had this before, but easier is to copy this what is just needed.

Copy link
Member

@xermicus xermicus Sep 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It follows that if we only have one image (i.e. there is only a single Dockerfile), "what is just needed" refers to everything, because what is not needed should be excluded by the .dockerignore anyways.

@@ -1 +0,0 @@
src/public
Copy link
Member

@xermicus xermicus Sep 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should at least contain node_modules?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to do not use .dockerignore for now

Copy link
Member

@xermicus xermicus Sep 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not? Without a correct .dockerignore, things like node_modules, .git etc. just bloat the build context and lead to unnecessary cache invalidations.

Having a correct .dockerignore is considered a best-pracitce and I think we should stick to that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

@xermicus xermicus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo the nits

@smiasojed smiasojed merged commit f318da5 into main Sep 24, 2024
2 checks passed
@smiasojed smiasojed deleted the sm/ci branch September 24, 2024 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants