-
Notifications
You must be signed in to change notification settings - Fork 0
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
Changes from all commits
8f1833a
cd8f083
8a34d97
7be00c7
49d3092
d5d56fe
10627c6
8592da3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,14 @@ | ||
src/public | ||
.git | ||
.github | ||
.gitignore | ||
.gitmodules | ||
.prettierrc | ||
artillery.yml | ||
Dockerfile | ||
pod.yaml | ||
README.md | ||
remix-project.patch | ||
node_modules | ||
remix-project | ||
public | ||
test |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
|
||
- name: Install packages | ||
run: npm ci | ||
|
||
- name: Install solc | ||
run: | | ||
mkdir -p solc | ||
wget https://github.com/ethereum/solidity/releases/download/v0.8.26/solc-static-linux \ | ||
-O solc/solc && chmod +x solc/solc | ||
echo "$(pwd)/solc/" >> $GITHUB_PATH | ||
|
||
- name: Install resolc | ||
run: | | ||
mkdir -p resolc | ||
wget https://github.com/smiasojed/revive/releases/download/0.0.1/resolc \ | ||
-O resolc/resolc && chmod +x resolc/resolc | ||
echo "$(pwd)/resolc/" >> $GITHUB_PATH | ||
|
||
- name: Test | ||
run: npm test | ||
timeout-minutes: 5 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ WORKDIR /app | |
COPY package*.json ./ | ||
RUN npm ci --only=production | ||
COPY utils/ ./utils | ||
COPY config/ ./config | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All those copies can just be There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
COPY server.js ./ | ||
RUN chown -R node:node /app | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
server: { | ||
port: 3000, | ||
compilationTimeout: 10000, | ||
}, | ||
}; |
There was a problem hiding this comment.
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
?There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done