Skip to content

LLVM verification

LLVM verification #634

Workflow file for this run

name: Regression test
on:
pull_request:
branches:
- main
workflow_dispatch:
jobs:
regress-pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/action@v3.0.1
regress-smoke:
needs: build-llvm
runs-on: ubuntu-latest
env:
SINGULARITY: 1
steps:
- name: Clone Github Repo Action
uses: actions/checkout@v4
- name: Setup apptainer
uses: eWaterCycle/setup-apptainer@v2.0.0
- name: Get container from cache
id: cache-sif
uses: actions/cache@v4
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@v4
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
SINGULARITY: 1
steps:
- name: Clone Github Repo Action
uses: actions/checkout@v4
- name: Setup apptainer
uses: eWaterCycle/setup-apptainer@v2.0.0
- name: Get container from cache
id: cache-sif
uses: actions/cache@v4
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@v4
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
SINGULARITY: 1
steps:
- name: Clone Github Repo Action
uses: actions/checkout@v4
- name: Setup apptainer
uses: eWaterCycle/setup-apptainer@v2.0.0
- name: Get container from cache
id: cache-sif
uses: actions/cache@v4
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@v4
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
env:
SINGULARITY: 1
steps:
- name: Clone Github Repo Action
uses: actions/checkout@v4
- name: Get current LLVM submodule commit SHA
id: get-llvm-sha
run: echo "LLVM_SHA=$(git ls-tree HEAD ext/llvm-project | awk '{print $3}')" >> $GITHUB_ENV
- name: Restore cache RISC-V JSON
id: cache-riscv
uses: actions/cache@v4
with:
path: ext/llvm-project/riscv.json
key: ${{ runner.os }}-riscv-json-${{ env.LLVM_SHA }}
restore-keys: |
${{ runner.os }}-riscv-json-
- name: Setup apptainer
uses: eWaterCycle/setup-apptainer@v2.0.0
- name: Get container from cache
id: cache-sif
uses: actions/cache@v4
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@v4
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
env:
SINGULARITY: 1
steps:
- name: Clone Github Repo Action
uses: actions/checkout@v4
- name: Setup apptainer
uses: eWaterCycle/setup-apptainer@v2.0.0
- name: Get container from cache
id: cache-sif
uses: actions/cache@v4
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@v4
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:profile[MockProfileRelease]
build-llvm:
runs-on: ubuntu-latest
steps:
- name: Check out repository (no submodules, shallow fetch)
uses: actions/checkout@v4
with:
submodules: false
fetch-depth: 1
- name: Get current LLVM submodule commit SHA
id: get-llvm-sha
run: echo "LLVM_SHA=$(git ls-tree HEAD ext/llvm-project | awk '{print $3}')" >> $GITHUB_ENV
- name: Cache RISC-V JSON
id: cache-riscv
uses: actions/cache@v4
with:
path: ext/llvm-project/riscv.json
key: ${{ runner.os }}-riscv-json-${{ env.LLVM_SHA }}
restore-keys: |
${{ runner.os }}-riscv-json-
- name: Initialize LLVM submodule (shallow + sparse)
if: ${{ steps.cache-riscv.outputs.cache-hit != 'true' }}
run: |
git submodule sync --recursive
git submodule update --init --recursive --depth=1 ext/llvm-project
- name: Check for required directories and files
if: ${{ steps.cache-riscv.outputs.cache-hit != 'true' }}
run: |
ls -l ext/llvm-project/llvm/include
ls -l ext/llvm-project/llvm/lib/Target/RISCV
ls -l ext/llvm-project/llvm/lib/Target/RISCV/RISCV.td
- name: Configure and build llvm-tblgen
if: ${{ steps.cache-riscv.outputs.cache-hit != 'true' }}
run: |
cmake -S ext/llvm-project/llvm -B ext/llvm-project/build -DCMAKE_BUILD_TYPE=Release
cmake --build ext/llvm-project/build --target llvm-tblgen
- name: Generate RISC-V JSON
if: ${{ steps.cache-riscv.outputs.cache-hit != 'true' }}
run: |
chmod +x ./ext/llvm-project/build/bin/llvm-tblgen
./ext/llvm-project/build/bin/llvm-tblgen \
-I ext/llvm-project/llvm/include \
-I ext/llvm-project/llvm/lib/Target/RISCV \
ext/llvm-project/llvm/lib/Target/RISCV/RISCV.td \
--dump-json \
-o ext/llvm-project/riscv.json
- name: Show riscv.json output
run: ls -l ext/llvm-project/riscv.json