Sharing binary on test using mutl-stage build and cache
We build CodeChain binary in every task in Travis. It takes about 10-15 mins per task.
- To run clippy and rustfmt
- To make sure it doesn't have a compile error.
- Unit tests and E2E tests.
- Dynamic validator tests 1
- Dynamic validator tests 2.
We at least use a build output from 3 in 4, 5. We might reuse a build cache from 2 in 3. When many features in clippy and rustfmt are stabilized, we also reuse the cache from 1 in 2.
We can do this relatively easily on Github Actions with artifacts than Travis CI. https://help.github.com/en/github/automating-your-workflow-with-github-actions/persisting-workflow-data-using-artifacts Describing task dependency in Github Actions is also easier than Travis CI. https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idneeds