Download chips/yosys/.github/workflows/test-compile.yml from STAR-future/Trinity-SciData: direct link, hf CLI and curl.
- Browser
- Download file 4.23 kB
-
https://huggingface.co/datasets/STAR-future/Trinity-SciData/resolve/main/chips/yosys/.github/workflows/test-compile.yml
- Command line
-
hf download hf://datasets/STAR-future/Trinity-SciData/chips/yosys/.github/workflows/test-compile.yml
-
curl -L -o test-compile.yml https://huggingface.co/datasets/STAR-future/Trinity-SciData/resolve/main/chips/yosys/.github/workflows/test-compile.yml
4.23 kB
| name: Compiler testing | |
| on: | |
| pull_request: | |
| merge_group: | |
| push: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| jobs: | |
| pre_job: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_skip: ${{ steps.set_output.outputs.should_skip }} | |
| steps: | |
| - id: skip_check | |
| if: ${{ github.event_name != 'merge_group' }} | |
| uses: fkirc/skip-duplicate-actions@v5.3.2 | |
| 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' }} | |
| - id: set_output | |
| run: | | |
| if [ "${{ github.event_name }}" = "merge_group" ]; then | |
| echo "should_skip=false" >> $GITHUB_OUTPUT | |
| elif [ "${{ github.event_name }}" = "push" ]; then | |
| should_skip=false | |
| else | |
| echo "should_skip=${{ steps.skip_check.outputs.should_skip }}" >> $GITHUB_OUTPUT | |
| fi | |
| test-compile: | |
| runs-on: ${{ matrix.os }} | |
| needs: pre_job | |
| if: (github.event_name == 'push' || github.event_name == 'merge_group' || github.event_name == 'workflow_dispatch') && needs.pre_job.outputs.should_skip != 'true' | |
| env: | |
| CXXFLAGS: ${{ startsWith(matrix.compiler, 'gcc') && '-Wp,-D_GLIBCXX_ASSERTIONS' || ''}} | |
| strategy: | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| compiler: | |
| # oldest supported | |
| - 'clang-16' | |
| - 'gcc-11' | |
| # newest, make sure to update maximum standard step to match | |
| - 'clang-22' | |
| - 'gcc-16' | |
| include: | |
| # macOS arm | |
| - os: macos-latest | |
| compiler: 'clang-22' | |
| fail-fast: false | |
| steps: | |
| - name: Checkout Yosys | |
| uses: actions/checkout@v7 | |
| with: | |
| submodules: true | |
| persist-credentials: false | |
| - name: Setup environment | |
| uses: ./.github/actions/setup-build-env | |
| with: | |
| runs-on: ${{ matrix.os }} | |
| get-build-deps: true | |
| - name: ccache | |
| uses: hendrikmuhs/ccache-action@v1.2.23 | |
| with: | |
| key: test-compile-${{ matrix.os }}-${{ matrix.compiler }} | |
| save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| restore-keys: | | |
| test-compile-${{ matrix.os }}-${{ matrix.compiler }}- | |
| - name: Setup Cpp | |
| uses: aminya/setup-cpp@v1 | |
| with: | |
| compiler: ${{ matrix.compiler }} | |
| gcc: ${{ (runner.os == 'Linux' && matrix.compiler == 'clang-16') && '13' || '' }} | |
| - name: Select compatible libstdc++ for Clang 16 | |
| if: runner.os == 'Linux' && matrix.compiler == 'clang-16' | |
| shell: bash | |
| run: | | |
| # Clang 16 cannot compile the ranges headers from libstdc++ 15. | |
| gcc_install_dir="$(dirname "$(gcc-13 -print-libgcc-file-name)")" | |
| echo "CXXFLAGS=${CXXFLAGS} --gcc-install-dir=${gcc_install_dir}" >> "$GITHUB_ENV" | |
| - name: Tool versions | |
| shell: bash | |
| run: | | |
| $CC --version | |
| $CXX --version | |
| # minimum standard | |
| - name: Build C++20 | |
| shell: bash | |
| run: | | |
| rm -rf build | |
| cmake -B build -DCMAKE_CXX_STANDARD=20 -DYOSYS_COMPILER_LAUNCHER=ccache . --fresh | |
| cmake --build build --target yosys -j$procs | |
| # maximum standard, only on newest compilers | |
| - name: Build C++26 | |
| if: ${{ matrix.compiler == 'clang-22' || matrix.compiler == 'gcc-16' }} | |
| shell: bash | |
| run: | | |
| rm -rf build | |
| cmake -B build -DCMAKE_CXX_STANDARD=26 -DYOSYS_COMPILER_LAUNCHER=ccache . --fresh | |
| cmake --build build --target yosys -j$procs | |
| test-compile-result: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - test-compile | |
| if: always() | |
| steps: | |
| - name: Check results | |
| run: | | |
| echo "Needs results: ${{ join(needs.*.result, ',') }}" | |
| if [[ "${{ join(needs.*.result, ',') }}" == *failure* ]] || \ | |
| [[ "${{ join(needs.*.result, ',') }}" == *cancelled* ]]; then | |
| echo "Some jobs failed or were cancelled" | |
| exit 1 | |
| fi | |
| - run: echo "All good" | |