phoenix-ru / fervid

All-in-One Vue compiler written in Rust
https://phoenix-ru.github.io/fervid/
Apache License 2.0
371 stars 9 forks source link

feat: add github actions workflows #8

Closed ErKeLost closed 10 months ago

ErKeLost commented 11 months ago

workflows

I've added a total of five files, maybe some of which you don't need, but I'll give you a choice, three of which are related to workflows, so let's talk about the remaining two files first.

Used to define sponsorship options for the GitHub repository so that project maintainers can accept and manage sponsorship, donation, and sponsor information. The existence of this file allows project maintainers to display a "Sponsor" button on the home page of their repository

stale file is typically used to configure the "stale" behavior in GitHub repositories, to automatically mark and handle long-unupdated questions (issues) and pull requests (PRs). This is useful for repositories in large open source projects or team collaboration to automatically identify and handle problems or PRs that have not been active for a long time to keep the repository clean and orderly.

Next, there are three files for the process of configuring workflow

The code-spell-check.yaml file is an GitHub Actions workflow configuration file that performs code spelling checking. Specifically, it is used to detect spelling errors in code files and generate relevant warnings or reports to help developers improve code quality.

The coverage.yaml file is an GitHub Actions workflow configuration file that performs code coverage checks. Specifically, it is used to measure test coverage in the code base to help developers understand how much their code has been tested.

Next is the more important link for us, cargo test.

Mainly used to perform continuous integration (CI,Continuous Integration) tasks for Rust projects

I hope these will help your project. I didn't test locally because it seemed troublesome, so there might be some problems, but I tried to avoid mistakes. @phoenix-ru

phoenix-ru commented 11 months ago

Hi @ErKeLost First of all, thanks for the PR

I haven't yet fully reviewed your suggestions (will do so somewhere during the week), but I found that you use Node 16 in the CI. Is there a reason for that?

Also, iirc Node already has PNPM built-in, it can be enabled using

corepack enable

As for now I'll approve the workflows and let them run. I'll come back later

ErKeLost commented 11 months ago

The reason for using node is only because e.g is checking the spelling of words, and we need some libraries from node to help us run the tool.

Although the main purpose of CI workflows is to perform tests and coverage analysis on Rust projects, Node.js may be required for project-related dependency management and some subsequent operations. Therefore, Node.js is a reasonable choice in this case to ensure the integrity and functionality of the workflow.

You said corepack. I may need to try again.

The existing ci is migrated based on workflows in farm. I see it's already running, and I'll fix other problems.

ErKeLost commented 11 months ago

I found something wrong with some of the paths. I'll fix them these days.

ErKeLost commented 10 months ago

@phoenix-ru

Ci workflow has been basically successful, but another problem now is that we use some experimental attributes like error

[E0658]: use of unstable library feature 'is_terminal' in our code.
-- > / home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anstream-0.6.4/src/stream.rs:121:9.
| |.
| 121 | std::io::IsTerminal::is_terminal (self) |.
| | ^ ^.
| |.
= note: see issue # 98070 < https://github.com/rust-lang/rust/issues/98070> for more information.
= help: add `#! [feature (is_terminal)] `to the crate attributes to enable

This question requires you to determine whether you need to turn on these new features. This pr can already be merged.

phoenix-ru commented 10 months ago

@ErKeLost Thanks again for your contribution. It's great already, although I have some questions.

  1. I'm not really sure what you mean by

    we use some experimental attributes like error And the terminal snippet you attached, what does it correspond to?

  1. I saw you added rust-toolchain.toml with a nightly compiler setting. What is this necessary for? I very much prefer to stay on stable Rust.

  2. Just a small suggestion. feat/workflows branch is out-of-date with master. It would be good if you would sync it to upstream before a pull. I do add a bunch of functionality and change tests as well.

All in all, thanks! Will merge it and tweak some things myself.