Skip to content

Commit

Permalink
Merge pull request #66 from WolframResearch/bugfix/cannot-download-wo…
Browse files Browse the repository at this point in the history
…rkflow-values-in-first-job

Bugfix/cannot download workflow values in first job
  • Loading branch information
rhennigan authored Oct 15, 2022
2 parents feba1b7 + 24bbf51 commit 25ad6eb
Show file tree
Hide file tree
Showing 15 changed files with 391 additions and 136 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/check-paclet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ jobs:
name: Check
runs-on: ubuntu-latest
container:
image: wolframresearch/wolframengine:latest
image: wolframresearch/wolframengine:13.0.1
options: --user root --privileged --init --ulimit core=-1
timeout-minutes: 20

steps:
- name: Setup debugging
if: env.ACTIONS_STEP_DEBUG
Expand All @@ -44,11 +45,11 @@ jobs:
uses: actions/checkout@v3

- name: Build paclet MX
run: wolframscript Scripts/BuildPacletMX.wls
run: bash Scripts/RunScript.sh BuildPacletMX.wls

- name: Check paclet
run: wolframscript Scripts/CheckPaclet.wls
run: bash Scripts/RunScript.sh CheckPaclet.wls

- name: Upload core dump
if: always() && env.ACTIONS_STEP_DEBUG
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -80,9 +81,10 @@ jobs:
name: Build
runs-on: ubuntu-latest
container:
image: wolframresearch/wolframengine:latest
image: wolframresearch/wolframengine:13.0.1
options: --user root --privileged --init --ulimit core=-1
timeout-minutes: 20

steps:
- name: Setup debugging
if: env.ACTIONS_STEP_DEBUG
Expand All @@ -96,10 +98,10 @@ jobs:
uses: actions/checkout@v3

- name: Build paclet MX
run: wolframscript Scripts/BuildPacletMX.wls
run: bash Scripts/RunScript.sh BuildPacletMX.wls

- name: Build paclet
run: wolframscript Scripts/BuildPaclet.wls
run: bash Scripts/RunScript.sh BuildPaclet.wls

- name: Upload core dump
if: always() && env.ACTIONS_STEP_DEBUG
Expand Down Expand Up @@ -140,7 +142,7 @@ jobs:
needs: [Build]
runs-on: ubuntu-latest
container:
image: wolframresearch/wolframengine:latest
image: wolframresearch/wolframengine:13.0.1
options: --user root
timeout-minutes: 10

Expand All @@ -163,7 +165,7 @@ jobs:
path: MXBuild

- name: Test paclet
run: wolframscript Scripts/TestPaclet.wls
run: bash Scripts/RunScript.sh TestPaclet.wls

- name: Upload stack data
if: always() && env.PACLET_STACK_HISTORY
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@ jobs:
image: wolframresearch/wolframengine:latest
options: --user root
timeout-minutes: 10

steps:
- name: Checkout files
uses: actions/checkout@v3

- name: Build paclet MX
run: wolframscript Scripts/BuildPacletMX.wls
run: bash Scripts/RunScript.sh BuildPacletMX.wls

- name: Check paclet
run: wolframscript Scripts/CheckPaclet.wls
run: bash Scripts/RunScript.sh CheckPaclet.wls

- name: Upload stack data
if: always() && env.PACLET_STACK_HISTORY
Expand All @@ -55,15 +56,16 @@ jobs:
image: wolframresearch/wolframengine:latest
options: --user root
timeout-minutes: 10

steps:
- name: Checkout files
uses: actions/checkout@v3

- name: Build paclet MX
run: wolframscript Scripts/BuildPacletMX.wls
run: bash Scripts/RunScript.sh BuildPacletMX.wls

- name: Build paclet
run: wolframscript Scripts/BuildPaclet.wls
run: bash Scripts/RunScript.sh BuildPaclet.wls

- name: Upload stack data
if: always() && env.PACLET_STACK_HISTORY
Expand Down Expand Up @@ -117,7 +119,7 @@ jobs:
path: MXBuild

- name: Test paclet
run: wolframscript Scripts/TestPaclet.wls
run: bash Scripts/RunScript.sh TestPaclet.wls

- name: Upload stack data
if: always() && env.PACLET_STACK_HISTORY
Expand Down Expand Up @@ -323,7 +325,7 @@ jobs:
path: Release

- name: Set release parameters
run: wolframscript Scripts/SetReleaseParameters.wls
run: bash Scripts/RunScript.sh SetReleaseParameters.wls

- name: Create release
id: create_release
Expand Down Expand Up @@ -376,10 +378,10 @@ jobs:
path: .paclet-workflow-values

- name: Build paclet MX
run: wolframscript Scripts/BuildPacletMX.wls
run: bash Scripts/RunScript.sh BuildPacletMX.wls

- name: Submit paclet
run: wolframscript Scripts/SubmitPaclet.wls
run: bash Scripts/RunScript.sh SubmitPaclet.wls

- name: Upload stack data
if: always() && env.PACLET_STACK_HISTORY
Expand Down
2 changes: 1 addition & 1 deletion Actions/build-paclet
Submodule build-paclet updated 1 files
+1 −1 Dockerfile
2 changes: 1 addition & 1 deletion Actions/check-paclet
Submodule check-paclet updated 1 files
+1 −1 Dockerfile
2 changes: 1 addition & 1 deletion Actions/submit-paclet
Submodule submit-paclet updated 1 files
+1 −1 Dockerfile
2 changes: 1 addition & 1 deletion Actions/test-paclet
Submodule test-paclet updated 1 files
+1 −1 Dockerfile
2 changes: 2 additions & 0 deletions Kernel/Loading.wl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(*Package Header*)
BeginPackage[ "Wolfram`PacletCICD`Internal`", { "Wolfram`PacletCICD`" } ];

$BuildingMX;
$MXFile;

ClearAll[
Expand Down Expand Up @@ -74,6 +75,7 @@ SetContextLoad[ sym_Symbol, context_String ] :=
BuildMX[ ] := (
LoadSubPackages[ ];
GeneralUtilities`EnsureDirectory @ DirectoryName @ $MXFile;
$BuildingMX = False;
DumpSave[ $MXFile, "Wolfram`PacletCICD`", "SymbolAttributes" -> False ];
$MXFile
);
Expand Down
2 changes: 1 addition & 1 deletion Kernel/PacletCICD.wl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ EndPackage[ ];
(* ::**********************************************************************:: *)
(* ::Section::Closed:: *)
(*Install Dependencies*)
If[ $VersionNumber < 13.2 && StringQ @ Environment[ "GITHUB_WORKFLOW" ],
If[ StringQ @ Environment[ "GITHUB_WORKFLOW" ],
Quiet[
PacletInstall[ "https://github.com/WolframResearch/PacletCICD/releases/download/DefinitionNotebookClient-1.18.0/DefinitionNotebookClient-1.18.0.paclet" ];
PacletInstall[ "https://github.com/WolframResearch/PacletCICD/releases/download/PacletResource-1.6.0/PacletResource-1.6.0.paclet" ];
Expand Down
3 changes: 3 additions & 0 deletions Kernel/Utilities.wl
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,9 @@ ghWFTag[ name_String? StringQ ] :=
StringRiffle[ { "PacletCICD", job, name }, "/" ] /; StringQ @ job
];

ghWFTag[ name_String? StringQ ] :=
StringRiffle[ { "PacletCICD", "Job", name }, "/" ];

ghWFTag // catchUndefined;

(* ::**********************************************************************:: *)
Expand Down
25 changes: 19 additions & 6 deletions Kernel/WorkflowValue.wl
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,23 @@ $stepRoot := GeneralUtilities`EnsureDirectory @ { $jobRoot, $ghStepID };

$wfDownloadLocation := ExpandFileName[ ".paclet-workflow-values" ];

$ghWFID := $ghWFID = StringJoin[
$ghWFID := StringJoin[
"__Workflow_",
URLEncode @ Replace[
Environment[ "GITHUB_WORKFLOW" ],
Except[ _String ] :> ""
]
];

$ghJobID := $ghJobID = StringJoin[
$ghJobID := StringJoin[
"__Job_",
URLEncode @ Replace[
Environment[ "GITHUB_JOB" ],
Except[ _String ] :> ""
]
];

$ghStepID := $ghStepID = StringJoin[
$ghStepID := StringJoin[
"__Step_",
IntegerString[ $SessionID, 36 ]
];
Expand All @@ -68,15 +68,28 @@ $$appendable = _List | _Association? AssociationQ;
(* ::**********************************************************************:: *)
(* ::Section::Closed:: *)
(*InitializeWorkflowValues*)
InitializeWorkflowValues[ ] := InitializeWorkflowValues @ $wfDownloadLocation;
InitializeWorkflowValues[ ] :=
If[ TrueQ @ Wolfram`PacletCICD`Internal`$BuildingMX,
Missing[ "NotAvailable" ],
setWorkflowValue[ ".initialization", Null ];
importExistingWorkflowValues[ ]
];

InitializeWorkflowValues // catchUndefined;

(* ::**********************************************************************:: *)
(* ::Subsection::Closed:: *)
(*importExistingWorkflowValues*)
importExistingWorkflowValues[ ] :=
importExistingWorkflowValues @ $wfDownloadLocation;

InitializeWorkflowValues[ src_? DirectoryQ ] :=
importExistingWorkflowValues[ src_? DirectoryQ ] :=
Module[ { files },
files = FileNames[ "*.wxf", src, Infinity ];
importDownloadedWFV[ src, # ] & /@ files
];

InitializeWorkflowValues[ ___ ] := Missing[ "NotAvailable" ];
importExistingWorkflowValues[ ___ ] := Missing[ "NotAvailable" ];

(* ::**********************************************************************:: *)
(* ::Subsection::Closed:: *)
Expand Down
Loading

0 comments on commit 25ad6eb

Please sign in to comment.