diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ea2c88f9416..477daf2dda8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,23 +34,20 @@ jobs: with: path: spec/Cache key: ${{ github.event.pull_request.base.sha }} + - if: ${{ steps.cache-builds.outputs.cache-hit != 'true' }} + name: Save changes to tests files + run: cp -r .busted spec /tmp/ - if: ${{ steps.cache-builds.outputs.cache-hit != 'true' }} name: Checkout dev uses: actions/checkout@v4 with: ref: 'dev' - if: ${{ steps.cache-builds.outputs.cache-hit != 'true' }} - name: Checkout new test related files in case they changed - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - sparse-checkout-cone-mode: false - sparse-checkout: | - .busted - spec/* + name: Patch dev with latest tests files + run: rm -rf .busted spec && cp -r /tmp/.busted /tmp/spec . - if: ${{ steps.cache-builds.outputs.cache-hit != 'true' }} name: Generate builds in reference to dev branch - run: BUILDCACHEPREFIX='${{ github.workspace }}/spec/Cache' busted --lua=luajit -r generate + run: BUILDCACHEPREFIX='./spec/Cache' busted --lua=luajit -r generate - name: Display differences run: > for build in spec/Cache/*.lua; diff --git a/spec/GenerateBuilds.lua b/spec/GenerateBuilds.lua index 70828ab63c9..e6f1b19b0cd 100644 --- a/spec/GenerateBuilds.lua +++ b/spec/GenerateBuilds.lua @@ -45,7 +45,7 @@ local buildList = fetchBuilds("../spec/TestBuilds") for filename, testBuild in pairs(buildList) do - print("[+] Computing " .. filename) + print("[+] Computing " .. filename:gsub("(.+)%..+$", (os.getenv("BUILDCACHEPREFIX") or "/tmp") .. "/%1.lua")) loadBuildFromXML(testBuild) local fileHnd, errMsg = io.open(filename:gsub("(.+)%..+$", (os.getenv("BUILDCACHEPREFIX") or "/tmp") .. "/%1.lua"), "w+") fileHnd:write(testBuild)