mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	* Fix building and running unit tests * Enable unit tests * Add gtest always * test-sanitizers.yml: Use makefile.conf * proper test setup * make it run on macOS * Run libyosys build only for unit tests after testing is done * Disable LTO on public CI --------- Co-authored-by: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com>
		
			
				
	
	
		
			85 lines
		
	
	
	
		
			2.4 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			85 lines
		
	
	
	
		
			2.4 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
name: Build and run tests with Verific (Linux)
 | 
						|
 | 
						|
on:
 | 
						|
  # always test main
 | 
						|
  push:
 | 
						|
    branches:
 | 
						|
      - main
 | 
						|
  # test PRs
 | 
						|
  pull_request:
 | 
						|
  # allow triggering tests, ignores skip check
 | 
						|
  workflow_dispatch:
 | 
						|
 | 
						|
jobs:
 | 
						|
  pre-job:
 | 
						|
    runs-on: ubuntu-latest
 | 
						|
    outputs:
 | 
						|
      should_skip: ${{ steps.skip_check.outputs.should_skip }}
 | 
						|
    steps:
 | 
						|
      - id: skip_check
 | 
						|
        uses: fkirc/skip-duplicate-actions@v5
 | 
						|
        with:
 | 
						|
          # don't run on documentation changes
 | 
						|
          paths_ignore: '["**/README.md", "docs/**", "guidelines/**"]'
 | 
						|
          # cancel previous builds if a new commit is pushed
 | 
						|
          # but never cancel main
 | 
						|
          cancel_others: ${{ github.ref != 'refs/heads/main' }}
 | 
						|
 | 
						|
  test-verific:
 | 
						|
    needs: pre-job
 | 
						|
    if: ${{ needs.pre-job.outputs.should_skip != 'true' && github.repository == 'YosysHQ/Yosys' }}
 | 
						|
    runs-on: [self-hosted, linux, x64, fast]
 | 
						|
    steps:
 | 
						|
      - name: Checkout Yosys
 | 
						|
        uses: actions/checkout@v4
 | 
						|
        with:
 | 
						|
          persist-credentials: false
 | 
						|
          submodules: true
 | 
						|
      - name: Runtime environment
 | 
						|
        run: |
 | 
						|
          echo "procs=$(nproc)" >> $GITHUB_ENV
 | 
						|
 | 
						|
      - name: Build Yosys
 | 
						|
        run: |
 | 
						|
          make config-clang
 | 
						|
          echo "ENABLE_VERIFIC := 1" >> Makefile.conf
 | 
						|
          echo "ENABLE_VERIFIC_EDIF := 1" >> Makefile.conf
 | 
						|
          echo "ENABLE_VERIFIC_LIBERTY := 1" >> Makefile.conf
 | 
						|
          echo "ENABLE_VERIFIC_YOSYSHQ_EXTENSIONS := 1" >> Makefile.conf
 | 
						|
          echo "ENABLE_CCACHE := 1" >> Makefile.conf
 | 
						|
          echo "ENABLE_FUNCTIONAL_TESTS := 1" >> Makefile.conf
 | 
						|
          make -j$procs ENABLE_LTO=1
 | 
						|
 | 
						|
      - name: Install Yosys
 | 
						|
        run: |
 | 
						|
          make install DESTDIR=${GITHUB_WORKSPACE}/.local PREFIX=
 | 
						|
 | 
						|
      - name: Checkout SBY
 | 
						|
        uses: actions/checkout@v4
 | 
						|
        with:
 | 
						|
          repository: 'YosysHQ/sby'
 | 
						|
          path: 'sby'
 | 
						|
          persist-credentials: false
 | 
						|
 | 
						|
      - name: Build SBY
 | 
						|
        run: |
 | 
						|
          make -C sby install DESTDIR=${GITHUB_WORKSPACE}/.local PREFIX=
 | 
						|
 | 
						|
      - name: Run Yosys tests
 | 
						|
        run: |
 | 
						|
          make -j$procs test
 | 
						|
 | 
						|
      - name: Run Verific specific Yosys tests
 | 
						|
        run: |
 | 
						|
          make -C tests/sva
 | 
						|
          cd tests/svtypes && bash run-test.sh
 | 
						|
 | 
						|
      - name: Run SBY tests
 | 
						|
        if: ${{ github.ref == 'refs/heads/main' }}
 | 
						|
        run: |
 | 
						|
          make -C sby run_ci
 | 
						|
 | 
						|
      - name: Run unit tests
 | 
						|
        shell: bash
 | 
						|
        run: |
 | 
						|
          make -j$procs unit-test ENABLE_LTO=1 ENABLE_LIBYOSYS=1
 |