Skip to content

Commit

Permalink
Merge branch 'main' into 332-create-better-profile-comparisons
Browse files Browse the repository at this point in the history
Signed-off-by: james-ball-qualcomm <[email protected]>
  • Loading branch information
james-ball-qualcomm authored Dec 4, 2024
2 parents c59841d + db49639 commit f14798e
Show file tree
Hide file tree
Showing 277 changed files with 8,085 additions and 66 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Regression test

on:
schedule:
- cron: '30 2 * * *'
workflow_dispatch:

jobs:
# check_date from: https://stackoverflow.com/questions/63014786/how-to-schedule-a-github-actions-nightly-build-but-run-it-only-when-there-where
check_date:
runs-on: ubuntu-latest
name: Check latest commit
outputs:
should_run: ${{ steps.should_run.outputs.should_run }}
steps:
- uses: actions/checkout@v2
- name: print latest_commit
run: echo ${{ github.sha }}

- id: should_run
continue-on-error: true
name: check latest commit is less than a day
if: ${{ github.event_name == 'schedule' }}
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"
nightly:
needs: check_date
if: ${{ needs.check_date.outputs.should_run != 'false' }}
runs-on: ubuntu-latest
steps:
- name: Clone Github Repo Action
uses: actions/checkout@v4
- name: Setup apptainer
uses: eWaterCycle/[email protected]
- name: Get container from cache
id: cache-sif
uses: actions/cache@v3
with:
path: .singularity/image.sif
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
- name: Get gems and node files from cache
id: cache-bundle-npm
uses: actions/cache@v3
with:
path: |
.home/.gems
node_modules
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
name: Build container
run: ./bin/build_container
- name: Setup project
run: ./bin/setup
- name: Run regression
run: ./do test:nightly
124 changes: 119 additions & 5 deletions .github/workflows/regress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,124 @@ on:
- main
workflow_dispatch:
jobs:
regress:
regress-smoke:
runs-on: ubuntu-latest
steps:
- name: Clone Github Repo Action
uses: actions/checkout@v4
- name: Setup apptainer
uses: eWaterCycle/[email protected]
- name: Get container from cache
id: cache-sif
uses: actions/cache@v3
with:
path: .singularity/image.sif
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
- name: Get gems and node files from cache
id: cache-bundle-npm
uses: actions/cache@v3
with:
path: |
.home/.gems
node_modules
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
name: Build container
run: ./bin/build_container
- name: Setup project
run: ./bin/setup
- name: Run smoke
run: ./do test:smoke
regress-gen-isa-manual:
runs-on: ubuntu-latest
needs: regress-smoke
env:
MANUAL_NAME: isa
VERSIONS: all
steps:
- name: Clone Github Repo Action
uses: actions/checkout@v4
- name: Setup apptainer
uses: eWaterCycle/[email protected]
- name: Get container from cache
id: cache-sif
uses: actions/cache@v3
with:
path: .singularity/image.sif
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
- name: Get gems and node files from cache
id: cache-bundle-npm
uses: actions/cache@v3
with:
path: |
.home/.gems
node_modules
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
name: Build container
run: ./bin/build_container
- name: Generate HTML ISA manual
run: ./do gen:html_manual
regress-gen-ext-pdf:
runs-on: ubuntu-latest
needs: regress-smoke
env:
EXT: B
VERSION: latest
steps:
- name: Clone Github Repo Action
uses: actions/checkout@v4
- name: Setup apptainer
uses: eWaterCycle/[email protected]
- name: Get container from cache
id: cache-sif
uses: actions/cache@v3
with:
path: .singularity/image.sif
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
- name: Get gems and node files from cache
id: cache-bundle-npm
uses: actions/cache@v3
with:
path: |
.home/.gems
node_modules
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
name: Build container
run: ./bin/build_container
- name: Generate extension PDF
run: ./do gen:ext_pdf
regress-gen-certificate:
runs-on: ubuntu-latest
needs: regress-smoke
steps:
- name: Clone Github Repo Action
uses: actions/checkout@v4
- name: Setup apptainer
uses: eWaterCycle/[email protected]
- name: Get container from cache
id: cache-sif
uses: actions/cache@v3
with:
path: .singularity/image.sif
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
- name: Get gems and node files from cache
id: cache-bundle-npm
uses: actions/cache@v3
with:
path: |
.home/.gems
node_modules
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
name: Build container
run: ./bin/build_container
- name: Generate extension PDF
run: ./do gen:cert_model_pdf[MockCertificateModel]
regress-gen-profile:
runs-on: ubuntu-latest
needs: regress-smoke
steps:
- name: Clone Github Repo Action
uses: actions/checkout@v4
Expand All @@ -29,7 +145,5 @@ jobs:
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
name: Build container
run: ./bin/build_container
- name: Setup project
run: ./bin/setup
- name: Run regression
run: ./do regress
- name: Generate extension PDF
run: ./do gen:profile[MockProfileRelease]
4 changes: 2 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ Quick start:
## examples
# validate against the schema
./do validate
# run smoke tests
./do test:smoke
# generate all versions of ISA manual, as an Antora static website
./do gen:html_manual MANUAL_NAME=isa VERSIONS=all
Expand Down
113 changes: 71 additions & 42 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,22 @@ namespace :serve do
end
end

desc "Run the IDL compiler test suite"
task :idl_test do
t = Minitest::TestTask.new(:lib_test)
t.test_globs = ["#{$root}/lib/idl/tests/test_*.rb"]
t.process_env
ruby t.make_test_cmd
end
namespace :test do
# "Run the IDL compiler test suite"
task :idl_compiler do
t = Minitest::TestTask.new(:lib_test)
t.test_globs = ["#{$root}/lib/idl/tests/test_*.rb"]
t.process_env
ruby t.make_test_cmd
end

desc "Run the Ruby library test suite"
task :lib_test do
t = Minitest::TestTask.new(:lib_test)
t.test_globs = ["#{$root}/lib/test/test_*.rb"]
t.process_env
ruby t.make_test_cmd
# "Run the Ruby library test suite"
task :lib do
t = Minitest::TestTask.new(:lib_test)
t.test_globs = ["#{$root}/lib/test/test_*.rb"]
t.process_env
ruby t.make_test_cmd
end
end

desc "Clean up all generated files"
Expand All @@ -77,7 +79,7 @@ task :clean do
FileUtils.rm_rf $root / ".stamps"
end

namespace :validate do
namespace :test do
task :insts do
puts "Checking instruction encodings..."
inst_paths = Dir.glob("#{$root}/arch/inst/**/*.yaml").map { |f| Pathname.new(f) }
Expand All @@ -95,9 +97,10 @@ namespace :validate do
progressbar.increment
validator.validate(f)
end
Rake::Task["test:insts"].invoke
puts "All files validate against their schema"
end
task idl: ["gen:arch", "#{$root}/.stamps/arch-gen-_32.stamp", "#{$root}/.stamps/arch-gen-_64.stamp"] do
task idl_model: ["gen:arch", "#{$root}/.stamps/arch-gen-_32.stamp", "#{$root}/.stamps/arch-gen-_64.stamp"] do
print "Parsing IDL code for RV32..."
arch_def_32 = arch_def_for("_32")
puts "done"
Expand All @@ -114,9 +117,6 @@ namespace :validate do
end
end

desc "Validate the arch docs"
task validate: ["validate:schema", "validate:idl", "validate:insts"]

def insert_warning(str, from)
# insert a warning on the second line
lines = str.lines
Expand Down Expand Up @@ -274,31 +274,60 @@ namespace :gen do
end
end

desc <<~DESC
Run the regression tests
namespace :test do
desc <<~DESC
Run smoke tests
These tests must pass before a commit will be allowed in the main branch on GitHub
DESC
task :regress do
Rake::Task["idl_test"].invoke
Rake::Task["lib_test"].invoke
Rake::Task["validate"].invoke
ENV["MANUAL_NAME"] = "isa"
ENV["VERSIONS"] = "all"
Rake::Task["gen:html_manual"].invoke
Rake::Task["gen:html"].invoke("generic_rv64")
ENV["EXT"] = "B"
ENV["VERSION"] = "latest"
Rake::Task["gen:ext_pdf"].invoke
Rake::Task["#{$root}/gen/certificate_doc/pdf/MockCertificateModel.pdf"].invoke
Rake::Task["#{$root}/gen/certificate_doc/pdf/MC100.pdf"].invoke
Rake::Task["#{$root}/gen/profile_doc/pdf/MockProfileRelease.pdf"].invoke
Rake::Task["#{$root}/gen/profile_doc/pdf/RVA20.pdf"].invoke
Rake::Task["#{$root}/gen/profile_doc/pdf/RVA22.pdf"].invoke
Rake::Task["#{$root}/gen/profile_doc/pdf/RVI20.pdf"].invoke
These are basic but fast-running tests to check the database and tools
DESC
task :smoke do
Rake::Task["test:idl_compiler"].invoke
Rake::Task["test:lib"].invoke
Rake::Task["test:schema"].invoke
Rake::Task["test:idl_model"].invoke
end

puts
puts "Regression test PASSED"
desc <<~DESC
Run the regression tests
These tests must pass before a commit will be allowed in the main branch on GitHub
DESC
task :regress do
Rake::Task["test:smoke"].invoke

ENV["MANUAL_NAME"] = "isa"
ENV["VERSIONS"] = "all"
Rake::Task["gen:html_manual"].invoke

ENV["EXT"] = "B"
ENV["VERSION"] = "latest"
Rake::Task["gen:ext_pdf"].invoke

Rake::Task["gen:html"].invoke("generic_rv64")

Rake::Task["#{$root}/gen/certificate_doc/pdf/MockCertificateModel.pdf"].invoke
Rake::Task["#{$root}/gen/profile_doc/pdf/MockProfileRelease.pdf"].invoke

puts
puts "Regression test PASSED"
end

desc <<~DESC
Run the nightly regression tests
Generally, this tries to build all artifacts
DESC
task :nightly do
Rake::Task["regress"].invoke

Rake::Task["#{$root}/gen/certificate_doc/pdf/MC100.pdf"].invoke
Rake::Task["#{$root}/gen/profile_doc/pdf/RVA20.pdf"].invoke
Rake::Task["#{$root}/gen/profile_doc/pdf/RVA22.pdf"].invoke
Rake::Task["#{$root}/gen/profile_doc/pdf/RVI20.pdf"].invoke

puts
puts "Nightly regression test PASSED"
end
end

desc <<~DESC
Expand Down Expand Up @@ -354,4 +383,4 @@ task MockCertificateModel: "#{$root}/gen/certificate_doc/pdf/MockCertificateMode
task RVI20: "#{$root}/gen/profile_doc/pdf/RVI20.pdf"
task RVA20: "#{$root}/gen/profile_doc/pdf/RVA20.pdf"
task RVA22: "#{$root}/gen/profile_doc/pdf/RVA22.pdf"
task MockProfileRelease: "#{$root}/gen/profile_doc/pdf/MockProfileRelease.pdf"
task MockProfileRelease: "#{$root}/gen/profile_doc/pdf/MockProfileRelease.pdf"
2 changes: 1 addition & 1 deletion arch/csr/H/htinst.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ fields:
return CsrFieldType::RO;
}
description: |
Exception-speicific information for a trap into HS-mode.
Exception-specific information for a trap into HS-mode.
reset_value: UNDEFINED_LEGAL
2 changes: 1 addition & 1 deletion arch/csr/H/htval.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ fields:
return CsrFieldType::RO;
}
description: |
Exception-speicific information for a trap into M-mode.
Exception-specific information for a trap into M-mode.
reset_value: UNDEFINED_LEGAL
2 changes: 1 addition & 1 deletion arch/csr/H/mtinst.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ fields:
return CsrFieldType::RO;
}
description: |
Exception-speicific information for a trap into M-mode.
Exception-specific information for a trap into M-mode.
reset_value: UNDEFINED_LEGAL
2 changes: 1 addition & 1 deletion arch/csr/H/mtval2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ fields:
return CsrFieldType::RO;
}
description: |
Exception-speicific information for a trap into M-mode.
Exception-specific information for a trap into M-mode.
reset_value: UNDEFINED_LEGAL
Loading

0 comments on commit f14798e

Please sign in to comment.