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

internal: add caching to GitHub Actions #2278

Merged
merged 1 commit into from
Dec 22, 2024

Conversation

Pospelove
Copy link
Contributor

@Pospelove Pospelove commented Dec 22, 2024

Important

Add steps to cache build directory and store current Git SHA in GitHub Actions workflow.

  • GitHub Actions:
    • Add step to cache build directory using actions/cache@v4 with key based on OS, hash of build-metadata.json, and current Git SHA.
    • Add step to get current Git SHA and store it in GitHub environment variables.

This description was created by Ellipsis for 86aa61b. It will automatically update as commits are pushed.

@ellipsis-dev ellipsis-dev bot changed the title . ci: add caching and Git SHA retrieval to GitHub Actions Dec 22, 2024
Copy link

@ellipsis-dev ellipsis-dev bot 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 to me! Reviewed everything up to 86aa61b in 34 seconds

More details
  • Looked at 24 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. .github/actions/pr_base/action.yml:80
  • Draft comment:
        key: ${{ runner.os }}-skymp-${{ hashFiles('./build-metadata.json') }}-${{ steps.repo_sha.outputs.sha }}
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The "Get Current Git SHA" step explicitly writes to GITHUB_ENV using Out-File -FilePath $Env:GITHUB_ENV, making it available as an environment variable. The comment suggests using step outputs, but the step doesn't set any outputs. The current code using env.sha is actually correct since it's reading from the environment variable where the SHA was stored.
    Could there be a reason why using step outputs would be better than environment variables in this case? Maybe there are GitHub Actions best practices I'm not aware of.
    While step outputs might be preferred in some cases, the current implementation explicitly uses environment variables, and the comment's suggestion would not work since no step output is being set.
    The comment should be deleted because it suggests an incorrect change - the SHA is stored in an environment variable, not step outputs, so the current code is correct.

Workflow ID: wflow_ILYg5IURu1YNozxi


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@Pospelove Pospelove changed the title ci: add caching and Git SHA retrieval to GitHub Actions internal: add caching to GitHub Actions Dec 22, 2024
@Pospelove Pospelove merged commit e6831f7 into skyrim-multiplayer:main Dec 22, 2024
12 checks passed
@Pospelove Pospelove deleted the cache branch December 22, 2024 23:49
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.

1 participant