-
Notifications
You must be signed in to change notification settings - Fork 9
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
ci: update ci and add xtask testing #233
Conversation
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
c45d353
to
d974fca
Compare
6a68add
to
95b05a3
Compare
d974fca
to
ef13dcf
Compare
95b05a3
to
03fead3
Compare
ef13dcf
to
6746cda
Compare
03fead3
to
7bdb25b
Compare
4823336
to
6bc41b9
Compare
8b9f586
to
2486741
Compare
6bc41b9
to
cdd8547
Compare
2486741
to
0d96325
Compare
cdd8547
to
86b8b43
Compare
0d96325
to
9af2377
Compare
86b8b43
to
5836747
Compare
RUN apt-get install -y nodejs multitail | ||
RUN npm install -g @zombienet/cli | ||
|
||
COPY --from=parity/polkadot:v1.6.0 /usr/bin/polkadot /usr/bin/ |
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.
At this point we could also extract this into an ARG
.
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 discovered that using ARG is more complex than expected. Doing something like this:
ARG POLKADOT=parity/polkadot:v1.6.0
FROM $POLKADOT as polkadot
COPY --from=polkadot /usr/bin/polkadot /usr/bin/
does not work because ARG can be defined at build time with an argument variable, and parity/polkadot:v1.6.0
would be used only if it is not specified. However, if it is specified but not assigned to anything, it would be empty, which is not valid for the FROM command. To make it work, it should be:
ARG POLKADOT=parity/polkadot:v1.6.0
FROM ${POLKADOT:-parity/polkadot:v1.6.0} as polkadot
COPY --from=polkadot /usr/bin/polkadot /usr/bin/
But if the goal is to reduce the lines that need to be changed on a Polkadot update, I opted for:
FROM parity/polkadot:v1.6.0 as polkadot
COPY --from=polkadot /usr/bin/polkadot /usr/bin/
xtask/src/main.rs
Outdated
|
||
std::env::set_var( | ||
"CONSTANTS_MANIFEST", | ||
format!("{}demo/sovereign/constants.json", project_dir), |
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.
Seems finicky: seems like you are assuming that project_dir
will always come with a trailing slash
, will that always be the case? Won't it be better to use Path
? As a bonus you will be able to check the directory existence.
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.
In the way I created the regex, it will contain the \, but you pointed out something really interesting. By using Path, the code becomes much cleaner and less errors prone
let path = std::path::Path::new(project_dir).join("demo/sovereign/constants.json");
if !path.exists() {
bail!(
"The `constants.json` file for Sovereign does not exist,\n \
or it is not in the expected position, `demo/sovereign/constants.json`"
)
}
std::env::set_var("CONSTANTS_MANIFEST", path);
9c6168c
to
03ddb09
Compare
03ddb09
to
c26d3bc
Compare
No description provided.