Skip to content

Commit

Permalink
FIX: path issue when generating dev builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Paliak committed Dec 25, 2023
1 parent a75b2a1 commit 75da53f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion spec/GenerateBuilds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 75da53f

Please sign in to comment.