Add Coverage flow for t1 #155
Workflow file for this run
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
name: Code linting | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- ready_for_review | |
- labeled | |
env: | |
USER: runner | |
# Cancel the current workflow when new commit pushed | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} | |
cancel-in-progress: true | |
jobs: | |
checkfmt: | |
name: "Check formats" | |
strategy: | |
fail-fast: false | |
runs-on: [self-hosted, linux, nixos] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.head_ref }} | |
- name: "Run testcases" | |
run: | | |
RET=0 | |
warnOnFileChanged() { | |
if ! git diff -q --exit-code; then | |
RET=1 | |
local msg="$1"; shift | |
echo "$msg" | |
echo "$msg" >> $GITHUB_STEP_SUMMARY | |
git reset --hard | |
fi | |
} | |
nix develop '.#t1.elaborator' -c mill -i configgen.reformat | |
nix develop '.#t1.elaborator' -c mill -i rocketv.reformat | |
nix develop '.#t1.elaborator' -c mill -i rocketemu.reformat | |
nix develop '.#t1.elaborator' -c mill -i t1.reformat | |
nix develop '.#t1.elaborator' -c mill -i t1emu.reformat | |
nix develop '.#t1.elaborator' -c mill -i t1rocket.reformat | |
nix develop '.#t1.elaborator' -c mill -i t1rocketemu.reformat | |
warnOnFileChanged "* Scala format fail, please run 'nix develop '.#t1.elaborator' -c mill -i _.reformat'" | |
nix fmt | |
warnOnFileChanged "* Nix format fail, please run 'nix fmt'" | |
pushd difftest | |
nix shell '.#cargo' '.#rustfmt' -c cargo fmt | |
warnOnFileChanged "* Cargo format fail, please run 'cd difftest; cargo -- format'" | |
popd | |
# Disable for now | |
# if nix run '.#ripgrep' -- '\p{Script=Han}' t1 > zh-hans.txt; then | |
# RET=1 | |
# msg="* Found ZH_CN comments" | |
# echo "$msg" | |
# echo "$msg" >> $GITHUB_STEP_SUMMARY | |
# echo '```text' >> $GITHUB_STEP_SUMMARY | |
# cat zh-hans.txt >> $GITHUB_STEP_SUMMARY | |
# echo '```' >> $GITHUB_STEP_SUMMARY | |
# git reset --hard | |
# fi | |
exit $RET |