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

Initial CI build #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Initial CI build #62

wants to merge 1 commit into from

Conversation

langston-barrett
Copy link

Fixes #42

Copy link
Contributor

@RyanGlScott RyanGlScott left a comment

Choose a reason for hiding this comment

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

Hooray! Thank you so much for doing this.

- name: Lint
run: cargo clippy

test:
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps this should be named "build" instead of "test"? At present, this job doesn't run any tests.

Comment on lines +40 to +46
- name: Upload binary
uses: actions/upload-artifact@v3
if: github.repository == 'GaloisInc/${{ env.NAME }}'
with:
name: "${{ env.NAME }}"
path: "target/release/${{ env.NAME }}"
if-no-files-found: error
Copy link
Contributor

Choose a reason for hiding this comment

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

Have you confirmed that the resulting binary is actually usable if the toolchain isn't installed?

@@ -6,7 +6,7 @@ fn main() {
// Add the toolchain lib/ directory to `-L`. This fixes the linker error "cannot find
// -lLLVM-13-rust-1.60.0-nightly".
let out = Command::new("rustup")
.args(&["which", "rustc"])
.args(["which", "rustc"])
Copy link
Contributor

Choose a reason for hiding this comment

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

This is surprising. What motivated this change?

Copy link
Author

Choose a reason for hiding this comment

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

Clippy! I can revert it if you prefer.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, right! Perhaps this belongs in a separate commit to make this clearer.

run: |
rustup default nightly-2023-01-23
rustup component add clippy rustc-dev
- uses: Swatinem/rust-cache@v2.7.0
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we should configure the cache a bit more to make it behave like our typical Haskell GHA setups. After reading the rust-cache README a bit, I think we should tweak the following:

  • I think we should enable cache-on-failure so that build dependencies will still cache even if building mir-json itself fails.
  • To future-proof this a little bit in case we accidentally corrupt the cache and need to invalidate it, I think it would be worth setting prefix-key: ${{ env.CACHE_VERSION }}, where CACHE_VERSION is a GHA environment variable.

Similarly for the use of rust-cache in the other job below.

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.

Add CI
2 participants