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

Refactor CI #65

Merged
merged 1 commit into from
Sep 2, 2024
Merged

Conversation

jakoschiko
Copy link
Contributor

@jakoschiko jakoschiko commented Sep 2, 2024

Okay... I neither understand GitHub Actions nor YAML... but I tried very hard!

The most important change is this:

    strategy:
      matrix:
        rust:
          - version: 1.58.1
            run-all: false
          - version: 1.80.1
            run-all: true

Now we have a variable run-all that we can use as a condition for tasks like cargo test. Easy.

      - name: Check lib
        run: $HOME/.cargo/bin/cargo check --lib

      - name: Check all
        # We can't use --all-targets because it includes benches which requires nightly compiler
        run: $HOME/.cargo/bin/cargo check --workspace --lib --bins --examples --tests
        if: ${{ matrix.rust.run-all }}

This works! I kept the older Rust version (1.58.1) because it tests the MSRV. But I increased the newer Rust version (1.61.0 -> 1.80.1) because it allows us to use shiny new stuff in tests and benchmarks.

Btw your cache didn't work. I think I fixed it. Previously you used the non-existing variable matrix.build. This resulted in this nice message:

Cache not found for input keys: -cargo-d04301ae37762a1e12b9e0e0deded45da81bd6e399ca943d66a6bb119bdd84c6, -cargo-

I was able to fix it by changing matrix.build to matrix.rust.version:

Cache restored successfully
Cache restored from key: 1.58.1-cargo-17a98d4477ebac4c9d1946e91ee5e564748d097ff95913d6e38944be8f2bdfb1

And one more think. I remove the line rustup component add rustfmt because it seems to be installed by default. This output was emitted before my change:

info: component 'rustfmt' for target 'x86_64-unknown-linux-gnu' is up to date

@jakoschiko
Copy link
Contributor Author

I want to highlight the execution time :p

image

@jakoschiko jakoschiko marked this pull request as ready for review September 2, 2024 20:42
@JesperAxelsson
Copy link
Owner

Ya, I think the CI script were quite out of date. Thank you for fixing them, the new timings look great!

@JesperAxelsson JesperAxelsson merged commit a9075f2 into JesperAxelsson:master Sep 2, 2024
2 checks passed
@jakoschiko jakoschiko deleted the refactor-ci branch September 17, 2024 20:57
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