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 scripts for CI #1574

Merged
merged 25 commits into from
Sep 4, 2024
Merged

Add scripts for CI #1574

merged 25 commits into from
Sep 4, 2024

Conversation

samuelchassot
Copy link
Collaborator

I also modified some of the existing scripts so that a local path to bolts can be passed if needed, default behaviour is still to clone bolts from github.

Some modifications on the bolts side are in the PR epfl-lara/bolts#106, such as using --compact for the longer case studies.

@samuelchassot
Copy link
Collaborator Author

So there are 2 different workflows:

  • Stainless CI: packages stainless, runs test and integration tests, and packages and tests the plugin
  • Stainless Nightly: packages stainless, runs the bolts tests

The CI one runs on pushes to main and for each PR (non-draft), the nightly runs every night.

@vkuncak vkuncak merged commit 1e816e6 into epfl-lara:main Sep 4, 2024
3 checks passed
name: Stainless CI
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think ready_for_review is useful. The default is [opened, synchronize, reopened], it seems to me you could just remove that line.

distribution: temurin
java-version: 17
- name: Install solvers
run: ./stainless-ci.sh --install-solvers $GITHUB_WORKSPACE/.local/bin
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see any caching here, does this run every time? Why not install the solvers once and for all on the CI server?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it's run everytime, which is quick, specially compared to the duration of the CI. We can setup them on the server indeed, that step is required if running on Github servers though. I'll check with Fabien if he can install them, then I'll run this only if the solvers are not available 👍
It also makes possible to change solvers version quickly, even for one PR.

- name: Build and Package
run: ./stainless-ci.sh --build-only
- name: Run Tests and Integration Tests
run: ./stainless-ci.sh --skip-build --skip-bolts --skip-sbt-plugin
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not just define this CLI interface as stainless-ci.sh [build|bolt-tests|sbt-tests|tests]? All these skip look a bit convoluted to me. A simpler interface could simplify your CI script. You could also pass options such as the bolts dir passed as env variables.

env:
# define Java options for both official sbt and sbt-extras
JAVA_OPTS: -Dsbt.io.implicit.relative.glob.conversion=allow -Xss512M -Xms1024M -Xmx12G -XX:MaxMetaspaceSize=2G -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=768M
JVM_OPTS: -Dsbt.io.implicit.relative.glob.conversion=allow -Xss512M -Xms1024M -Xmx12G -XX:MaxMetaspaceSize=2G -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=768M
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am wondering if you could avoid duplication with strategies described at https://docs.github.com/en/actions/sharing-automations/avoiding-duplication.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

indeed 👍
I didn't feel the need to do that given it was only a few lines.

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'll check though :)

mkdir -p "$SOLVERS_DIR"
mkdir -p "$TEMP_DIR"
# cvc5
wget https://github.com/cvc5/cvc5/releases/download/cvc5-1.1.2/cvc5-Linux-static.zip -O "$TEMP_DIR/downloaded.zip"
Copy link
Collaborator

Choose a reason for hiding this comment

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

 0K .......... .......... .......... .......... ..........  0% 4.62M 5s
    50K .......... .......... .......... .......... ..........  0% 5.87M 5s
   100K .......... .......... .......... .......... ..........  0% 26.3M 4s
   150K .......... .......... .......... .......... ..........  0% 31.6M 3s
   200K .......... .......... .......... .......... ..........  0% 8.17M 3s
   250K .......... .......... .......... .......... ..........  1% 34.0M 3s
   300K .......... .......... .......... .......... ..........  1% 59.0M 2s
   350K .......... .......... .......... .......... ..........  1% 34.4M 2s
   400K .......... .......... .......... .......... ..........  1% 51.1M 2s
   450K .......... .......... .......... .......... ..........  1% 11.1M 2s
   500K .......... .......... .......... .......... ..........  2% 52.8M 2s
   550K .......... .......... .......... .......... ..........  2% 52.4M 2s
   600K .......... .......... .......... .......... ..........  2%  126M 2s
   650K .......... .......... .......... .......... ..........  2% 71.4M 1s
   700K .......... .......... .......... .......... ..........  2%  122M 1s
   750K .......... .......... .......... .......... ..........  3%  102M 1s
   800K .......... .......... .......... .......... ..........  3% 93.4M 1s
   850K .......... .......... .......... .......... ..........  3%  102M 1s
   900K .......... .......... .......... .......... ..........  3% 93.8M 1s
   950K .......... .......... .......... .......... ..........  3% 12.4M 1s
  1000K .......... .......... .......... .......... ..........  4%  102M 1s
  1050K .......... .......... .......... .......... ..........  4%  130M 1s
  1100K .......... .......... .......... .......... ..........  4% 86.2M 1s
  1150K .......... .......... .......... .......... ..........  4% 90.2M 1s
  1200K .......... .......... .......... .......... ..........  4%  124M 1s
  1250K .......... .......... .......... .......... ..........  4%  100M 1s
  1300K .......... .......... .......... .......... ..........  5%  127M 1s
  1350K .......... .......... .......... .......... ..........  5%  119M 1s
  1400K .......... .......... .......... .......... ..........  5%  122M 1s
  1450K .......... .......... .......... .......... ..........  5%  104M 1s
  1500K .......... .......... .......... .......... ..........  5%  103M 1s
  1550K .......... .......... .......... .......... ..........  6%  109M 1s
  1600K .......... .......... .......... .......... ..........  6%  102M 1s

-q? 😄

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

haha 👍

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.

3 participants