-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(levm): merge daily hive jobs into a single job. (#1666)
**Motivation** DRY Merged the LEVM hive report and the REVM one
- Loading branch information
Showing
3 changed files
with
107 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Daily Lines of Code Report | ||
|
||
on: | ||
schedule: | ||
# Every day at UTC midnight | ||
- cron: "0 0 * * 1,2,3,4,5" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
loc: | ||
name: Count ethrex loc and generate report | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Rustup toolchain install | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: ${{ env.RUST_VERSION }} | ||
|
||
- name: Add Rust Cache | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Restore cache | ||
id: cache-loc-report | ||
uses: actions/cache@v4 | ||
with: | ||
path: loc_report.json | ||
key: loc-report-${{ github.ref_name }} | ||
restore-keys: | | ||
loc-report- | ||
- name: Rename cached loc_report.json to loc_report.json.old | ||
if: steps.cache-loc-report.outputs.cache-hit != '' | ||
run: mv loc_report.json loc_report.json.old | ||
|
||
- name: Generate the loc report | ||
run: | | ||
make loc | ||
- name: Save new loc_report.json to cache | ||
if: success() | ||
uses: actions/cache@v4 | ||
with: | ||
path: loc_report.json | ||
key: loc-report-${{ github.ref_name }} | ||
|
||
- name: Post results in summary | ||
run: | | ||
echo "# 'ethrex' lines of code report" >> $GITHUB_STEP_SUMMARY | ||
cat loc_report_github.txt >> $GITHUB_STEP_SUMMARY | ||
- name: Post results to ethrex L1 slack channel | ||
env: | ||
url: ${{ secrets.ETHREX_L1_SLACK_WEBHOOK }} | ||
run: sh .github/scripts/publish_loc.sh | ||
|
||
- name: Post results to ethrex L2 slack channel | ||
env: | ||
url: ${{ secrets.ETHREX_L2_SLACK_WEBHOOK }} | ||
run: sh .github/scripts/publish_loc.sh | ||
|
||
- name: Post results to levm slack channel | ||
env: | ||
url: ${{ secrets.LEVM_SLACK_WEBHOOK }} | ||
run: sh .github/scripts/publish_loc.sh | ||
|
||
# This is left commented out to ease debugging later on. | ||
# Comment out all the other "Post to * slack channel" directives | ||
# - name: Post results to test slack channel | ||
# env: | ||
# url: ${{ secrets.TEST_CHANNEL_SLACK }} | ||
# run: sh .github/scripts/publish_loc.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.