Skip to content

Move Linux CI from Azure Pipelines to GitHub Actions #1232

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

Merged
merged 1 commit into from
May 13, 2025

Conversation

joshtriplett
Copy link
Contributor

@joshtriplett joshtriplett commented May 8, 2025

This simplifies the CI setup substantially. In particular, this installs packages as part of the CI setup, rather than in a separate manual container build step where modifications by contributors are ineffective until the container images are regenerated.

Now, changes to provisioning will take immediate effect, allowing upgrades to new versions to be contributed and tested easily.

This does not move macOS over, because I don't have sufficient experience with macOS to easily debug the issues that occur when attempting to do so.

@joshtriplett joshtriplett force-pushed the switch-to-github-actions branch 2 times, most recently from ca30d92 to a7bf658 Compare May 8, 2025 16:44
@joshtriplett
Copy link
Contributor Author

@kkysen Would you mind safelisting Swatinem/rust-cache for GitHub Actions?

@joshtriplett joshtriplett force-pushed the switch-to-github-actions branch 4 times, most recently from 6945fa0 to 1cd2856 Compare May 8, 2025 18:01
@kkysen
Copy link
Contributor

kkysen commented May 8, 2025

@kkysen Would you mind safelisting Swatinem/rust-cache for GitHub Actions?

Do you know how to do that?

@joshtriplett
Copy link
Contributor Author

@kkysen Would you mind safelisting Swatinem/rust-cache for GitHub Actions?

Do you know how to do that?

I believe it'll be in the GitHub actions settings, either for the project or for the organization. There's a setting for where it can run actions from.

@kkysen
Copy link
Contributor

kkysen commented May 8, 2025

@kkysen Would you mind safelisting Swatinem/rust-cache for GitHub Actions?

Do you know how to do that?

I believe it'll be in the GitHub actions settings, either for the project or for the organization. There's a setting for where it can run actions from.

@thedataking, can you see if you're able to do this? I don't see where I can, or I probably don't have permission to do it. See the error message here: https://github.com/immunant/c2rust/actions/runs/14911291371.

@joshtriplett joshtriplett force-pushed the switch-to-github-actions branch 4 times, most recently from e0c2712 to 6dacb8c Compare May 9, 2025 00:42
@joshtriplett joshtriplett force-pushed the switch-to-github-actions branch 3 times, most recently from 4c3a0a7 to 959db55 Compare May 12, 2025 17:28
@joshtriplett joshtriplett changed the title WIP: Move from Azure Pipelines to GitHub Actions Move Linux CI from Azure Pipelines to GitHub Actions May 12, 2025
@joshtriplett
Copy link
Contributor Author

@kkysen I think this is ready to merge now.

@joshtriplett joshtriplett requested a review from kkysen May 12, 2025 23:53
Copy link
Contributor

@kkysen kkysen left a comment

Choose a reason for hiding this comment

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

LGTM but I'd still like @thedataking to take a final look, particularly about moving from testing on multiple distros to just Ubuntu. I think it's likely fine, and GitHub Actions have numerous benefits, but I just want to double check.

@kkysen kkysen requested a review from thedataking May 13, 2025 03:42
@kkysen
Copy link
Contributor

kkysen commented May 13, 2025

Also I'm re-running CI to see how long a cached CI takes, although that should improve a bunch with rust-cache.

@thedataking
Copy link
Contributor

@joshtriplett appreciate the work to fix our CI. Thanks!

Would you mind safelisting Swatinem/rust-cache for GitHub Actions?

I'd prefer to use the "vanilla" cache module unless there is some clear benefit. Wouldn't the pattern below work?

      - name: cache rust crates
        uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/bin/
            ~/.cargo/registry/index/
            ~/.cargo/registry/cache/
            ~/.cargo/git/db/
            target/
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

@kkysen
Copy link
Contributor

kkysen commented May 13, 2025

I updated this. We still have macOS to do, right?

@joshtriplett
Copy link
Contributor Author

@joshtriplett appreciate the work to fix our CI. Thanks!

Would you mind safelisting Swatinem/rust-cache for GitHub Actions?

I'd prefer to use the "vanilla" cache module unless there is some clear benefit. Wouldn't the pattern below work?

      - name: cache rust crates
        uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/bin/
            ~/.cargo/registry/index/
            ~/.cargo/registry/cache/
            ~/.cargo/git/db/
            target/
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

Caching correctly is a lot more complicated than that, and also involves caching more than that. The cache needs to depend on the toolchain, the job, etc. And the cache should include the results of compiling the dependencies, so that most builds are relatively fast. Doing it right requires logic on par with what rust-cache already does.

If you want to lock it down to a specific version of rust-cache, we could do that, and be very deliberate about upgrading it.

@thedataking
Copy link
Contributor

Thanks for educating me. Khyber mentioned that rust-lang also uses this action which eases my concern somewhat.

If you want to lock it down to a specific version of rust-cache, we could do that, and be very deliberate about upgrading it.

OK, v2 should be whitelisted now. Could we have a comment in the workflow to remind us why we're not using Github's cache action?

This simplifies the CI setup substantially. In particular, this
installs packages as part of the CI setup, rather than in a separate
manual container build step where modifications by contributors are
ineffective until the container images are regenerated.

Now, changes to provisioning will take immediate effect, allowing
upgrades to new versions to be contributed and tested easily.

This does not move macOS over, because I don't have sufficient
experience with macOS to easily debug the issues that occur when
attempting to do so.

Fixes: immunant#1226
@joshtriplett joshtriplett force-pushed the switch-to-github-actions branch from 959db55 to 8add06a Compare May 13, 2025 12:02
@joshtriplett
Copy link
Contributor Author

@kkysen OK, this is ready now, fixes all the items that have been commented on, and uses caching.

Copy link
Contributor

@kkysen kkysen left a comment

Choose a reason for hiding this comment

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

All good now, thank you!!

@kkysen kkysen merged commit 22d2085 into immunant:master May 13, 2025
2 of 3 checks passed
@joshtriplett joshtriplett deleted the switch-to-github-actions branch May 13, 2025 20:22
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