mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-28 18:29:25 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			126 lines
		
	
	
	
		
			3.7 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			126 lines
		
	
	
	
		
			3.7 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
| name: Test extra build flows
 | |
| 
 | |
| 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' }}
 | |
| 
 | |
|   vs-prep:
 | |
|     name: Prepare Visual Studio build
 | |
|     runs-on: ubuntu-latest
 | |
|     needs: [pre_job]
 | |
|     if: needs.pre_job.outputs.should_skip != 'true'
 | |
|     steps:
 | |
|       - uses: actions/checkout@v4
 | |
|         with:
 | |
|           submodules: true
 | |
|           persist-credentials: false
 | |
|       - run: sudo apt-get install libfl-dev
 | |
|       - name: Build
 | |
|         run: make vcxsrc YOSYS_VER=latest
 | |
|       - uses: actions/upload-artifact@v4
 | |
|         with:
 | |
|           name: vcxsrc
 | |
|           path: yosys-win32-vcxsrc-latest.zip
 | |
| 
 | |
|   vs-build:
 | |
|     name: Visual Studio build
 | |
|     runs-on: windows-latest
 | |
|     needs: [vs-prep, pre_job]
 | |
|     if: needs.pre_job.outputs.should_skip != 'true'
 | |
|     steps:
 | |
|       - uses: actions/download-artifact@v4
 | |
|         with:
 | |
|           name: vcxsrc
 | |
|           path: .
 | |
|       - name: unzip
 | |
|         run: unzip yosys-win32-vcxsrc-latest.zip
 | |
|       - name: setup-msbuild
 | |
|         uses: microsoft/setup-msbuild@v2
 | |
|       - name: MSBuild
 | |
|         working-directory: yosys-win32-vcxsrc-latest
 | |
|         run: msbuild YosysVS.sln /p:PlatformToolset=v142 /p:Configuration=Release /p:WindowsTargetPlatformVersion=10.0.26100.0
 | |
| 
 | |
|   wasi-build:
 | |
|     name: WASI build
 | |
|     needs: pre_job
 | |
|     if: needs.pre_job.outputs.should_skip != 'true'
 | |
|     runs-on: ubuntu-latest
 | |
|     steps:
 | |
|       - uses: actions/checkout@v4
 | |
|         with:
 | |
|           submodules: true
 | |
|           persist-credentials: false
 | |
|       - name: Build
 | |
|         run: |
 | |
|           WASI_SDK=wasi-sdk-19.0
 | |
|           WASI_SDK_URL=https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-19/wasi-sdk-19.0-linux.tar.gz
 | |
|           if ! [ -d ${WASI_SDK} ]; then curl -L ${WASI_SDK_URL} | tar xzf -; fi
 | |
| 
 | |
|           FLEX_VER=2.6.4
 | |
|           FLEX=flex-${FLEX_VER}
 | |
|           FLEX_URL=https://github.com/westes/flex/releases/download/v${FLEX_VER}/${FLEX}.tar.gz
 | |
|           if ! [ -d ${FLEX} ]; then curl -L ${FLEX_URL} | tar xzf -; fi
 | |
| 
 | |
|           mkdir -p flex-build
 | |
|           (cd flex-build &&
 | |
|             ../${FLEX}/configure --prefix=$(pwd)/../flex-prefix &&
 | |
|             make &&
 | |
|             make install)
 | |
| 
 | |
|           mkdir -p build
 | |
|           cat > build/Makefile.conf <<END
 | |
|           export PATH := $(pwd)/${WASI_SDK}/bin:$(pwd)/flex-prefix/bin:${PATH}
 | |
|           WASI_SYSROOT := $(pwd)/${WASI_SDK}/share/wasi-sysroot
 | |
| 
 | |
|           CONFIG := wasi
 | |
|           PREFIX := /
 | |
| 
 | |
|           ENABLE_TCL := 0
 | |
|           ENABLE_READLINE := 0
 | |
|           ENABLE_PLUGINS := 0
 | |
|           ENABLE_ZLIB := 0
 | |
| 
 | |
|           CXXFLAGS += -I$(pwd)/flex-prefix/include
 | |
|           END
 | |
| 
 | |
|           make -C build -f ../Makefile CXX=clang -j$(nproc)
 | |
| 
 | |
|   nix-build:
 | |
|     name: "Build nix flake"
 | |
|     needs: pre_job
 | |
|     if: needs.pre_job.outputs.should_skip != 'true'
 | |
|     runs-on: ${{ matrix.os }}
 | |
|     strategy:
 | |
|       matrix:
 | |
|         os: [ubuntu-latest, macos-latest]
 | |
|       fail-fast: false
 | |
|     steps:
 | |
|       - uses: actions/checkout@v4
 | |
|         with:
 | |
|           submodules: true
 | |
|           persist-credentials: false
 | |
|       - uses: cachix/install-nix-action@v31
 | |
|         with:
 | |
|           install_url: https://releases.nixos.org/nix/nix-2.30.0/install
 | |
|       - run: nix build .?submodules=1 -L
 |