replace informal "thru" to "through" #9
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| pull_request: | |
| branches: [master] | |
| env: | |
| http_proxy: http://proxy-dmz.intel.com:912 | |
| https_proxy: http://proxy-dmz.intel.com:912 | |
| DOCKER_BUILDKIT: '1' | |
| VER: '1.12' | |
| jobs: | |
| build: | |
| runs-on: [self-hosted, Linux] | |
| if: github.repository_owner == 'intel-innersource' | |
| steps: | |
| - name: Checkout spec-head | |
| uses: actions/checkout@v4 | |
| with: | |
| clean: true | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| path: spec-head | |
| - name: Checkout spec-base | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: master | |
| clean: true | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| path: spec-base | |
| - name: Build container image | |
| run: | #bash | |
| docker build \ | |
| --build-arg http_proxy=http://proxy-dmz.intel.com:912 \ | |
| --build-arg https_proxy=http://proxy-dmz.intel.com:912 \ | |
| -t ghcr.io/oneapi-src/spec-build:latest \ | |
| - < spec-head/.github/docker/build.Dockerfile | |
| - name: Generate spec-head artifacts | |
| run: | #bash | |
| docker run \ | |
| --rm \ | |
| -v $PWD:$PWD \ | |
| -w $PWD/spec-head/scripts \ | |
| -e TZ=UTC \ | |
| ghcr.io/oneapi-src/spec-build:latest \ | |
| python3 ./run.py --debug --html '--!build' --ver $VER | |
| - name: Generate spec-base artifacts | |
| run: | #bash | |
| docker run \ | |
| --rm \ | |
| -v $PWD:$PWD \ | |
| -w $PWD/spec-base/scripts \ | |
| -e TZ=UTC \ | |
| ghcr.io/oneapi-src/spec-build:latest \ | |
| python3 ./run.py --debug '--!build' --ver $VER | |
| - name: Determine if there is a diff between header files | |
| id: include-diff | |
| run: | #bash | |
| if git diff --quiet --exit-code -- spec-head/include spec-base/include; then | |
| echo "diff=0" >> $GITHUB_OUTPUT | |
| else | |
| echo "diff=1" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Get header diff | |
| if: steps.include-diff.outputs.diff == '1' | |
| run: git diff --no-index spec-base/include spec-head/include > header-diff.patch || true | |
| - name: Write comment with formatting to DIFF_COMMENT | |
| if: steps.include-diff.outputs.diff == '1' | |
| shell: python3 {0} | |
| run: | | |
| import os | |
| with open('header-diff.patch', 'r') as f: | |
| diff_content = f.read() | |
| diff_comment = f"```diff\n{diff_content}\n```" | |
| # https://trstringer.com/github-actions-multiline-strings/#option-2---environment-variable | |
| with open(os.environ['GITHUB_ENV'], 'a') as env: | |
| print('RESULTS_COMMENT<<EOF', file = env) | |
| print(diff_comment, file = env) | |
| print('EOF', file = env) | |
| - name: Write comment to PR | |
| uses: actions/github-script@v6 | |
| if: steps.include-diff.outputs.diff == '1' | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| [, pullRequestId] = /refs\/pull\/(\d+)\/merge/g.exec(context.ref); | |
| github.rest.issues.createComment({ | |
| issue_number: pullRequestId, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: process.env.RESULTS_COMMENT | |
| }); | |
| - name: Write job summary | |
| if: steps.include-diff.outputs.diff == '1' | |
| run: echo "${RESULTS_COMMENT}" >> ${GITHUB_STEP_SUMMARY} | |
| - name: Checkout loader-head | |
| uses: actions/checkout@v4 | |
| with: | |
| clean: true | |
| repository: oneapi-src/level-zero | |
| ref: spec-1.12 | |
| path: loader-head | |
| - name: Checkout loader-base | |
| uses: actions/checkout@v4 | |
| with: | |
| clean: true | |
| repository: oneapi-src/level-zero | |
| ref: spec-1.12 | |
| path: loader-base | |
| - uses: intel-sandbox/action-setup-jq@main | |
| - name: Copy head include files | |
| working-directory: spec-head | |
| run: | #bash | |
| set -o pipefail | |
| jq -r '.[] | select(.|test("^../include"))' scripts/generated.json | | |
| cut -c 4- | | |
| sort | | |
| xargs -I{} cp -v ./{} ../loader-head/{} | |
| - name: Copy base include files | |
| working-directory: spec-base | |
| run: | #bash | |
| set -o pipefail | |
| jq -r '.[] | select(.|test("^../include"))' scripts/generated.json | | |
| cut -c 4- | | |
| sort | | |
| xargs -I{} cp -v ./{} ../loader-base/{} | |
| - name: json2src head | |
| run: | #bash | |
| docker run \ | |
| --rm \ | |
| --interactive \ | |
| -v $PWD:$PWD \ | |
| -w $PWD/loader-head \ | |
| ghcr.io/oneapi-src/spec-build:latest \ | |
| python3 ./scripts/json2src.py --ver $VER . < spec-head/scripts/input.json | |
| - name: json2src base | |
| run: | #bash | |
| docker run \ | |
| --rm \ | |
| --interactive \ | |
| -v $PWD:$PWD \ | |
| -w $PWD/loader-base \ | |
| ghcr.io/oneapi-src/spec-build:latest \ | |
| python3 ./scripts/json2src.py --ver $VER . < spec-base/scripts/input.json | |
| - name: Build loader-head | |
| working-directory: loader-head | |
| run: | #bash | |
| docker run \ | |
| --rm \ | |
| --interactive \ | |
| -v $PWD:$PWD \ | |
| -w $PWD \ | |
| -e CXXFLAGS="-Og -g" \ | |
| ghcr.io/oneapi-src/spec-build:latest \ | |
| bash -e <<EOF | |
| mkdir -p build | |
| cd build | |
| cmake -D CMAKE_BUILD_TYPE=Debug .. | |
| make -j$(nproc) | |
| EOF | |
| - name: Build loader-base | |
| working-directory: loader-base | |
| run: | #bash | |
| docker run \ | |
| --rm \ | |
| --interactive \ | |
| -v $PWD:$PWD \ | |
| -w $PWD \ | |
| -e CXXFLAGS="-Og -g" \ | |
| ghcr.io/oneapi-src/spec-build:latest \ | |
| bash -e <<EOF | |
| mkdir -p build | |
| cd build | |
| cmake -D CMAKE_BUILD_TYPE=Debug .. | |
| make -j$(nproc) | |
| EOF | |
| - name: Checkout abi-dumper | |
| uses: actions/checkout@v4 | |
| with: | |
| clean: true | |
| repository: lvc/abi-dumper | |
| path: abi-dumper | |
| - name: Setup abi-dumper | |
| run: | #bash | |
| cp abi-dumper/abi-dumper.pl . | |
| chmod +x abi-dumper.pl | |
| - name: Dump loader-head | |
| run: | #bash | |
| docker run \ | |
| --rm \ | |
| -v $PWD:$PWD \ | |
| -w $PWD \ | |
| ghcr.io/oneapi-src/spec-build:latest \ | |
| ./abi-dumper.pl \ | |
| loader-head/build/lib/libze_loader.so \ | |
| -lver $(cat loader-head/build/VERSION)-1 \ | |
| -public-headers loader-head/include \ | |
| -o head.dump | |
| - name: Dump loader-base | |
| run: | #bash | |
| docker run \ | |
| --rm \ | |
| -v $PWD:$PWD \ | |
| -w $PWD \ | |
| ghcr.io/oneapi-src/spec-build:latest \ | |
| ./abi-dumper.pl \ | |
| loader-base/build/lib/libze_loader.so \ | |
| -lver $(cat loader-base/build/VERSION) \ | |
| -public-headers loader-base/include \ | |
| -o base.dump | |
| - name: Download and setup abi-compliance-checker | |
| run: | | |
| wget https://github.com/lvc/abi-compliance-checker/tarball/master -O abi-compliance-checker.tar.gz | |
| tar -xzf abi-compliance-checker.tar.gz | |
| chmod +x lvc-abi-compliance-checker-*/abi-compliance-checker.pl | |
| - name: Compare dumps | |
| run: | | |
| docker run \ | |
| --rm \ | |
| -v $PWD:$PWD \ | |
| -w $PWD \ | |
| ghcr.io/oneapi-src/spec-build:latest \ | |
| lvc-abi-compliance-checker-*/abi-compliance-checker.pl \ | |
| -l libze_loader \ | |
| -old base.dump \ | |
| -new head.dump \ | |
| -report-path report.html | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: abi-report | |
| path: report.html |