2021-05-06 16:24:57 +00:00
|
|
|
# Lazy jobs running on master post merges.
|
|
|
|
name: lazy
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [master]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
coverage:
|
|
|
|
name: Coverage
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
- name: Generate report
|
|
|
|
uses: actions-rs/tarpaulin@v0.1
|
|
|
|
with:
|
2021-06-13 12:38:40 +00:00
|
|
|
args: '--tests --all-features --workspace'
|
2021-05-06 16:24:57 +00:00
|
|
|
- name: Upload to codecov.io
|
|
|
|
uses: codecov/codecov-action@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
- name: Archive code coverage results
|
|
|
|
uses: actions/upload-artifact@v1
|
|
|
|
with:
|
|
|
|
name: code-coverage-report
|
|
|
|
path: cobertura.xml
|
2021-11-01 03:58:58 +00:00
|
|
|
|
2021-05-20 03:24:09 +00:00
|
|
|
parse-dota2:
|
|
|
|
name: Parse Dota2 shaders
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
|
|
|
- run: mkdir data
|
|
|
|
- name: Download shaders
|
|
|
|
run: curl https://user.fm/files/v2-5573e18b9f03f42c6ae53c392083da35/dota2-shaders.zip -o data/all.zip
|
|
|
|
- name: Unpack shaders
|
|
|
|
run: cd data && unzip all.zip
|
|
|
|
- name: Build Naga
|
2021-06-16 13:41:01 +00:00
|
|
|
run: cargo build --release --bin naga
|
2021-05-20 03:24:09 +00:00
|
|
|
- name: Convert shaders
|
|
|
|
run: for file in data/*.spv ; do echo "Translating" ${file} && target/release/naga --validate 27 ${file} ${file}.metal; done
|
2021-11-01 03:58:58 +00:00
|
|
|
|
2021-05-20 12:14:09 +00:00
|
|
|
parse-vulkan-tutorial-shaders:
|
|
|
|
name: Parse Sascha Willems Vulkan tutorial shaders
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
|
|
|
- name: Download shaders
|
|
|
|
run: git clone https://github.com/SaschaWillems/Vulkan.git
|
|
|
|
- name: Build Naga
|
2021-06-16 13:41:01 +00:00
|
|
|
run: cargo build --release --bin naga
|
2021-05-20 12:14:09 +00:00
|
|
|
- name: Convert metal shaders
|
|
|
|
run: |
|
|
|
|
# No needed to stop workflow if we can't validate one file
|
|
|
|
set +e
|
|
|
|
touch counter
|
|
|
|
SUCCESS_RESULT_COUNT=0
|
|
|
|
FILE_COUNT=0
|
|
|
|
mkdir -p out
|
|
|
|
find "Vulkan/data/shaders/glsl/" -name '*.spv' | while read fname;
|
|
|
|
do
|
|
|
|
echo "Convert: $fname"
|
|
|
|
FILE_COUNT=$((FILE_COUNT+1))
|
|
|
|
target/release/naga --validate 27 $(realpath ${fname}) out/$(basename ${fname}).metal
|
|
|
|
if [[ $? -eq 0 ]]; then
|
|
|
|
SUCCESS_RESULT_COUNT=$((SUCCESS_RESULT_COUNT + 1))
|
|
|
|
fi
|
|
|
|
echo "Result: $(expr $FILE_COUNT - $SUCCESS_RESULT_COUNT) / $FILE_COUNT" > counter
|
|
|
|
done
|
|
|
|
cat counter
|
2021-11-01 03:58:58 +00:00
|
|
|
|
2021-06-29 15:36:40 +00:00
|
|
|
dneto0_spirv-samples:
|
|
|
|
name: Parse dneto0 spirv-samples
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
|
|
|
- name: Download shaders
|
|
|
|
run: git clone https://github.com/dneto0/spirv-samples.git
|
|
|
|
- name: Build Naga
|
|
|
|
run: cargo build --release --bin naga
|
|
|
|
- name: Install spirv-tools
|
|
|
|
run: |
|
|
|
|
wget -q https://storage.googleapis.com/spirv-tools/artifacts/prod/graphics_shader_compiler/spirv-tools/linux-clang-release/continuous/1489/20210629-121459/install.tgz
|
|
|
|
tar zxf install.tgz
|
|
|
|
./install/bin/spirv-as --version
|
|
|
|
- name: Compile spv from spvasm
|
|
|
|
run: |
|
|
|
|
cd spirv-samples
|
|
|
|
mkdir -p spv
|
|
|
|
|
|
|
|
find "./spvasm" -name '*.spvasm' | while read fname;
|
|
|
|
do
|
|
|
|
echo "Convert to spv with spirv-as: $fname"
|
|
|
|
../install/bin/spirv-as --target-env spv1.3 $(realpath ${fname}) -o ./spv/$(basename ${fname}).spv
|
|
|
|
done;
|
|
|
|
- name: Validate spv and generate wgsl
|
|
|
|
run: |
|
|
|
|
set +e
|
|
|
|
cd spirv-samples
|
|
|
|
SUCCESS_RESULT_COUNT=0
|
|
|
|
FILE_COUNT=0
|
|
|
|
mkdir -p spv
|
|
|
|
mkdir -p wgsl
|
|
|
|
|
|
|
|
echo "==== Validate spv and generate wgsl ===="
|
|
|
|
rm -f counter
|
|
|
|
touch counter
|
|
|
|
|
|
|
|
find "./spv" -name '*.spv' | while read fname;
|
|
|
|
do
|
|
|
|
echo "Convert: $fname"
|
|
|
|
FILE_COUNT=$((FILE_COUNT+1))
|
|
|
|
../target/release/naga --validate 27 $(realpath ${fname}) ./wgsl/$(basename ${fname}).wgsl
|
|
|
|
if [[ $? -eq 0 ]]; then
|
|
|
|
SUCCESS_RESULT_COUNT=$((SUCCESS_RESULT_COUNT + 1))
|
|
|
|
fi
|
|
|
|
echo "Result: $(expr $FILE_COUNT - $SUCCESS_RESULT_COUNT) / $FILE_COUNT" > counter
|
|
|
|
done
|
|
|
|
cat counter
|
|
|
|
- name: Validate output wgsl
|
|
|
|
run: |
|
|
|
|
set +e
|
|
|
|
cd spirv-samples
|
|
|
|
SUCCESS_RESULT_COUNT=0
|
|
|
|
FILE_COUNT=0
|
|
|
|
|
|
|
|
rm -f counter
|
|
|
|
touch counter
|
|
|
|
|
|
|
|
find "./wgsl" -name '*.wgsl' | while read fname;
|
|
|
|
do
|
|
|
|
echo "Validate: $fname"
|
|
|
|
FILE_COUNT=$((FILE_COUNT+1))
|
|
|
|
../target/release/naga --validate 27 $(realpath ${fname})
|
|
|
|
if [[ $? -eq 0 ]]; then
|
|
|
|
SUCCESS_RESULT_COUNT=$((SUCCESS_RESULT_COUNT + 1))
|
|
|
|
fi
|
|
|
|
echo "Result: $(expr $FILE_COUNT - $SUCCESS_RESULT_COUNT) / $FILE_COUNT" > counter
|
|
|
|
done
|
|
|
|
cat counter
|
2021-11-01 03:58:58 +00:00
|
|
|
|
|
|
|
check-snapshots-extra:
|
|
|
|
name: Check snapshots (validated or not)
|
2021-10-05 19:11:32 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-10-06 01:01:54 +00:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
2021-11-01 03:58:58 +00:00
|
|
|
- uses: actions-rs/cargo@v1
|
|
|
|
name: Test minimal (without span)
|
|
|
|
with:
|
|
|
|
command: test
|
|
|
|
args: --features validate -p naga
|
2021-10-05 19:11:32 +00:00
|
|
|
- uses: actions-rs/cargo@v1
|
|
|
|
name: Test all (without validation)
|
|
|
|
with:
|
|
|
|
command: test
|
|
|
|
args: --features wgsl-in,wgsl-out,glsl-in,glsl-out,spv-in,spv-out,msl-out,hlsl-out,dot-out --workspace
|
|
|
|
- name: Check snapshots (without validation)
|
|
|
|
run: git diff --exit-code -- tests/out
|