Fix DeleteW #13
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
| name: Build USVFS | |
| on: | |
| push: | |
| branches: [master, dev/cmake] | |
| tags: | |
| - "*" | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| build: | |
| name: Build USVFS | |
| strategy: | |
| matrix: | |
| arch: [x86, x64] | |
| config: [Debug, Release] | |
| runs-on: windows-2022 | |
| steps: | |
| # Set vcpkg root directory | |
| - name: "Set environment variables" | |
| shell: bash | |
| run: | | |
| echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV | |
| # Checkout code | |
| - uses: actions/checkout@v4 | |
| # Setup vcpkg binary caching (GitHub Actions cache) | |
| - name: Configure vcpkg cache | |
| uses: actions/cache@v4 | |
| id: cache-vcpkg | |
| with: | |
| path: | | |
| ${{ env.VCPKG_ROOT }}/downloads | |
| ${{ env.VCPKG_ROOT }}/installed | |
| ${{ env.VCPKG_ROOT }}/buildtrees | |
| key: ${{ runner.os }}-vcpkg-${{ matrix.arch }}-${{ matrix.config }}-${{ hashFiles('**/vcpkg.json', '**/CMakeLists.txt', '**/vcpkg-configuration.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-vcpkg-${{ matrix.arch }}-${{ matrix.config }}- | |
| ${{ runner.os }}-vcpkg- | |
| # Configure | |
| - name: Configure CMake | |
| run: cmake --preset vs2022-windows-${{ matrix.arch }} -B build_${{ matrix.arch }} "-DCMAKE_INSTALL_PREFIX=install/${{ matrix.config }}" | |
| # Build | |
| - name: Build project | |
| run: cmake --build build_${{ matrix.arch }} --config ${{ matrix.config }} --target INSTALL | |
| # Package install files | |
| - name: Upload install files | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: usvfs_${{ matrix.config }}_${{ matrix.arch }} | |
| path: ./install/${{ matrix.config }} | |
| # Package test files, etc. | |
| - name: Upload library files | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: usvfs-libs_${{ matrix.config }}_${{ matrix.arch }} | |
| path: ./lib | |
| - name: Upload binary files | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: usvfs-bins_${{ matrix.config }}_${{ matrix.arch }} | |
| path: ./bin | |
| - name: Upload test files | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: usvfs-tests_${{ matrix.config }}_${{ matrix.arch }} | |
| path: ./test/bin | |
| # Merge x86/x64 test artifacts | |
| merge-artifacts-for-tests: | |
| runs-on: ubuntu-latest | |
| name: Merge Test Artifacts | |
| needs: build | |
| strategy: | |
| matrix: | |
| config: [Debug, Release] | |
| steps: | |
| - name: Merge USVFS library files | |
| uses: actions/upload-artifact/merge@v4 | |
| with: | |
| name: usvfs-libs_${{ matrix.config }} | |
| pattern: usvfs-libs_${{ matrix.config }}_* | |
| - name: Merge USVFS binary files | |
| uses: actions/upload-artifact/merge@v4 | |
| with: | |
| name: usvfs-bins_${{ matrix.config }} | |
| pattern: usvfs-bins_${{ matrix.config }}_* | |
| - name: Merge USVFS test files | |
| uses: actions/upload-artifact/merge@v4 | |
| with: | |
| name: usvfs-tests_${{ matrix.config }} | |
| pattern: usvfs-tests_${{ matrix.config }}_* | |
| # Merge x86/x64 install artifacts | |
| merge-artifacts-for-release: | |
| runs-on: ubuntu-latest | |
| name: Merge Install Artifacts | |
| needs: build | |
| strategy: | |
| matrix: | |
| config: [Debug, Release] | |
| steps: | |
| - name: Merge USVFS install files | |
| uses: actions/upload-artifact/merge@v4 | |
| with: | |
| name: usvfs_${{ matrix.config }} | |
| pattern: usvfs_${{ matrix.config }}_* | |
| test: | |
| name: Test USVFS | |
| needs: merge-artifacts-for-tests | |
| runs-on: windows-2022 | |
| strategy: | |
| matrix: | |
| config: [Debug, Release] | |
| arch: [x86, x64] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: usvfs-libs_${{ matrix.config }} | |
| path: ./lib | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: usvfs-bins_${{ matrix.config }} | |
| path: ./bin | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: usvfs-tests_${{ matrix.config }} | |
| path: ./test/bin | |
| - name: Run shared tests | |
| run: ./test/bin/shared_test_${{ matrix.arch }}.exe | |
| if: always() | |
| - name: Run injection tests | |
| run: ./test/bin/testinject_bin_${{ matrix.arch }}.exe | |
| if: always() | |
| - name: Run hook library tests | |
| run: ./test/bin/thooklib_test_${{ matrix.arch }}.exe | |
| if: always() | |
| - name: Run inject library tests | |
| run: ./test/bin/tinjectlib_test_${{ matrix.arch }}.exe | |
| if: always() | |
| - name: Run VFS tests | |
| run: ./test/bin/tvfs_test_${{ matrix.arch }}.exe | |
| if: always() | |
| - name: Run USVFS test runner | |
| run: ./test/bin/usvfs_test_runner_${{ matrix.arch }}.exe | |
| if: always() | |
| - name: Run USVFS global test runner | |
| run: ./test/bin/usvfs_global_test_runner_${{ matrix.arch }}.exe | |
| if: always() | |
| - name: Upload test outputs | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: tests-outputs_${{ matrix.config }}_${{ matrix.arch }} | |
| path: ./test/temp | |
| if-no-files-found: ignore | |
| retention-days: 7 | |
| overwrite: true | |
| publish: | |
| if: github.ref_type == 'tag' | |
| needs: [merge-artifacts-for-release, test] | |
| runs-on: windows-2022 | |
| permissions: | |
| contents: write | |
| steps: | |
| # USVFS does not use different names for Debug and Release so we are going to | |
| # retrieve both install artifacts and put them under install/ and install/debug/ | |
| - name: Download Release artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: usvfs_Release | |
| path: ./install | |
| - name: Download Debug artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: usvfs_Debug | |
| path: ./install/debug | |
| - name: Create USVFS base archive | |
| run: 7z a usvfs_${{ github.ref_name }}.7z ./install/* | |
| - name: Publish Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| GH_REPO: ${{ github.repository }} | |
| run: gh release create --draft=false --notes="Release ${{ github.ref_name }}" "${{ github.ref_name }}" ./usvfs_${{ github.ref_name }}.7z |