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

chore: made Rust CI workflow #27

Merged
merged 5 commits into from
Oct 1, 2023
Merged

chore: made Rust CI workflow #27

merged 5 commits into from
Oct 1, 2023

Conversation

taeh98
Copy link
Contributor

@taeh98 taeh98 commented Oct 1, 2023

  • This PR adds CI for your Rust code
  • It runs multiple checks on your code automatically to check it for errors
  • It checks it compiles, runs any tests you've made, runs lints, and checks for security vulnerabilities
  • This helps standardise your code and detect issues earlier and more easily, saving time and effort

Copy link
Owner

@Spydr06 Spydr06 left a comment

Choose a reason for hiding this comment

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

Thanks for this and great idea! I've added two things that need changing below

Comment on lines 37 to 38
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
Copy link
Owner

Choose a reason for hiding this comment

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

Two things with this:

  • LogicRs requires the nightly toolchain (idk if that's available with this toolchain provider)
  • I'd prefer if we used the official rust solution and not depend on third-party tools. I'm not that into CI, so if there's a good reason against that, please lmk

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey, thanks for your feedback.

To your first point, yeah, I'll change it over to the nightly toolchain if that's what your code needs.

To your second, there isn't an official Rust GitHub action, but dtolnay/rust-toolchain is now what most people use. I think the checkout action has been updated though, so I'll update it and also recheck everything else is up-to-date too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK @Spydr06,

I just finished moving all the actions over to the nightly toolchain, updating the checkout action used, and moving everything over to the de-facto standard actions used for jobs. Please let me know if you have any further thoughts. Thanks! :)

Copy link
Owner

Choose a reason for hiding this comment

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

To your second, rust-lang/rustup#3409. I think the checkout action has been updated though, so I'll update it and also recheck everything else is up-to-date too.

Ah ok, did not know that. Then it's fine ofc

@Spydr06 Spydr06 added hacktoberfest-accepted Accepted PR for the 2023 Hacktoberfest and removed hacktoberfest-accepted Accepted PR for the 2023 Hacktoberfest labels Oct 1, 2023
Copy link
Owner

@Spydr06 Spydr06 left a comment

Choose a reason for hiding this comment

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

Looks good, I hope this works :P

@Spydr06 Spydr06 merged commit 9dfef9c into Spydr06:main Oct 1, 2023
@Spydr06
Copy link
Owner

Spydr06 commented Oct 1, 2023

@taeh98 image
some system libs are missing, can you add the following packages and their -dev versions to the container?

  • gtk4, gtk4-dev
  • libcairo, libcairo-dev
  • libadwaita, libadwaita-dev

@taeh98
Copy link
Contributor Author

taeh98 commented Oct 1, 2023

@taeh98 image some system libs are missing, can you add the following packages and their -dev versions to the container?

* `gtk4`, `gtk4-dev`

* `libcairo`, `libcairo-dev`

* `libadwaita`, `libadwaita-dev`

Hey @Spydr06, sorry it isn't working :/

Are those apt dependencies (or something similar)? The jobs run in an Ubtuntu container, so I imagine fixing this issue would just require running an extra apt install step if so? I'll make a new branch to fix them since you merged this MR.

@Spydr06
Copy link
Owner

Spydr06 commented Oct 1, 2023

yep exactly, you need to install them using apt. It should be the following packages:
build-essential, libadwaita-1-dev, libcairo2-dev, libgtk-4-dev

@taeh98
Copy link
Contributor Author

taeh98 commented Oct 1, 2023

@Spydr06 looking at the output of this job, are you sure the dependencies are right? I'm currently installing:
packages: build-essential libadwaita-1-dev libcairo2-dev libgtk-4-dev

@Spydr06
Copy link
Owner

Spydr06 commented Oct 1, 2023

should be correct, other stuff like libpango (from the screenshot) is a dependency iirc.

@Spydr06
Copy link
Owner

Spydr06 commented Oct 1, 2023

if it doesn't work, we can always add it later since the CI will now trigger on each commit automatically

@taeh98
Copy link
Contributor Author

taeh98 commented Oct 1, 2023

@Spydr06 I don't think they're the right dependencies. Looking at this commit where I added the dependencies you mentioned, the CI checks still fail because of missing dependencies. Are the dependencies definitely right and all you need to run your code? Is there an extra step required, like a build step maybe?

Here's the error:

error: failed to run custom build command for `libadwaita-sys v0.2.1`

Caused by:
  process didn't exit successfully: `/home/runner/work/logicrs/logicrs/target/debug/build/libadwaita-sys-2f78e7a6d0c10bf9/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=LIBADWAITA_1_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:warning=`PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "libadwaita-1" "libadwaita-1 >= 1.2"` did not exit successfully: exit status: 1
  error: could not find system library 'libadwaita-1' required by the 'libadwaita-sys' crate

  --- stderr
  Requested 'libadwaita-1 >= 1.2' but version of Adwaita is 1.1.7

warning: build failed, waiting for other jobs to finish...
Error: Process completed with exit code 101.

@Spydr06
Copy link
Owner

Spydr06 commented Oct 1, 2023

It seems like the version of libadwaita Ubunu ships with is outdated... We require 1.2 while Ubuntu only ships 1.7.1

@Spydr06
Copy link
Owner

Spydr06 commented Oct 1, 2023

I can try if there's a newer package locally

@taeh98
Copy link
Contributor Author

taeh98 commented Oct 1, 2023

I can try if there's a newer package locally

OK, let me know what happens please :)

@Spydr06
Copy link
Owner

Spydr06 commented Oct 1, 2023

Ok, it compiles without problem on ubuntu 23.04, your current CI setup uses 22.10 (because it's LTS). Try changing the ubuntu-latest to ubuntu-23.04 or sth

toadkarter added a commit to toadkarter/logicrs that referenced this pull request Oct 8, 2023
author toadkarter <[email protected]> 1696714738 +0100
committer toadkarter <[email protected]> 1696751330 +0100

parent 3b28ab6
author toadkarter <[email protected]> 1696714738 +0100
committer toadkarter <[email protected]> 1696751324 +0100

# This is the 1st commit message:

Adds serialized settings file that saves theme state.

# This is the commit message Spydr06#2:

#Adding functionality for saving theme to config file.

# This is the commit message Spydr06#3:

#Loading custom theme if a new window has been created.

# This is the commit message Spydr06#4:

#Setting initial radio button state to what is in the settings when loading Theme.

# This is the commit message Spydr06#5:

#Changing settings file to save in the OS specific config directory.

# This is the commit message Spydr06#6:

#Adding Fedora dependencies to Readme.

# This is the commit message Spydr06#7:

#adding code of conduct

# This is the commit message Spydr06#8:

#edit code of conduct

# This is the commit message Spydr06#9:

#edit code of conduct

# This is the commit message Spydr06#10:

#chore: made Rust CI workflow
# This is the commit message Spydr06#11:

#added explanatory comments to rust_ci.yml
# This is the commit message Spydr06#12:

#updated checkout action

# This is the commit message Spydr06#13:

#used official cargo deny action

# This is the commit message Spydr06#14:

#use nightly toolchain

# This is the commit message Spydr06#15:

#Update INSTALL.md
# This is the commit message Spydr06#16:

#Bump version number
# This is the commit message Spydr06#17:

#Bump version number to `0.1.2`
# This is the commit message Spydr06#18:

#new examples

# This is the commit message Spydr06#19:

#Add macos install instructions
# This is the commit message Spydr06#20:

#ci: added libadwaita build steps to get CI jobs working

# This is the commit message Spydr06#21:

#added nsi script

# This is the commit message Spydr06#22:

#changed directories

# This is the commit message Spydr06#23:

#added relative path

# This is the commit message Spydr06#24:

#Delete nsi script directory
# This is the commit message Spydr06#25:

#Implement mux and demux

# This is the commit message Spydr06#26:

#add docs for mux, demux

# This is the commit message Spydr06#27:

#cargo fmt

#fix clippy issues

encoder decoder examples

fix CI issues with `cargo audit` and `cargo deny`

improve rendering of connection being drawn

add d flip flop, d latch, fix t flip flop

Fix examples, add q and !q to flip flops

Add docs for flip flops

run cargo fmt

fix macos shortcuts

Update README.md

cmd+backspace for deletion on mac

Add build instructions for libadwaita

Fixing up imports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Accepted PR for the 2023 Hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants