-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: Introduce XS CI workflow #2465
Conversation
a21437e
to
713abb1
Compare
004dd04
to
061240f
Compare
.github/workflows/ci.yml
Outdated
- name: Run yarn build | ||
run: yarn build | ||
|
||
- name: Get XS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's an idea:
- name: Get XS | |
- name: Check release | |
id: check-release | |
run: | | |
if curl -f -s -o /dev/null -I -L https://api.github.com/repos/Moddable-OpenSource/moddable/releases/tags/${{ matrix.moddable-version }} then | |
echo "release=true" | |
else | |
echo "release=false" | |
fi >> $GITHUB_OUTPUT | |
- name: Get XS | |
if: steps.check-release.outputs.release == 'true' |
With the build step if it's not.
.github/workflows/ci.yml
Outdated
# - name: Clone XS | ||
# run: git clone https://github.com/moddable-OpenSource/moddable --branch "${{ matrix.moddable-version }}" --depth 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend using actions/checkout
, also avoid to checkout as a subfolder of the repo under testing, it tends to complicate things
2ed5693
to
51b25fd
Compare
51b25fd
to
4e42535
Compare
@mhofman I took your cue and reworked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to see some Endo tests getting run by XS! This'll be good to land.
I'm approving conditionally on you deciding to confirm or deny my suggested changes. From that point a passing CI is all I'm looking for.
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if you were aware of this, but actions/checkout@v4
has the following default for `path':
# Relative path under $GITHUB_WORKSPACE to place the repository
path: ''
So this means the checkouts you do later with path: moddable
are checking out to $GITHUB_WORKSPACE/moddable
.
If you meant for the endo and moddable checkouts to be siblings (as I understand @mhofman was suggesting) instead of moddable
being a subdirectory of the endo
checkout, you need something like:
uses: actions/checkout@v4 | |
uses: actions/checkout@v4 | |
path: endo |
I'll make further suggestions for changes along that line. If the status quo is sufficient, feel free to ignore those suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed I was suggesting for them to be siblings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.
.github/workflows/ci.yml
Outdated
- name: Install dependencies | ||
run: yarn install --immutable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Install dependencies | |
run: yarn install --immutable | |
working-directory: endo |
.github/workflows/ci.yml
Outdated
- name: Run yarn build | ||
run: yarn build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- name: Run yarn build | |
run: yarn build | |
- name: Run yarn build | |
run: yarn build | |
working-directory: endo |
.github/workflows/ci.yml
Outdated
|
||
- name: Download XS | ||
if: steps.check-release.outputs.release == 'download' | ||
working-directory: .. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
working-directory: .. |
.github/workflows/ci.yml
Outdated
- name: Run XS tests | ||
run: | | ||
PATH=$PATH:$GITHUB_WORKSPACE/moddable/build/bin/lin/debug | ||
yarn lerna run test:xs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- name: Run XS tests | |
run: | | |
PATH=$PATH:$GITHUB_WORKSPACE/moddable/build/bin/lin/debug | |
yarn lerna run test:xs | |
- name: Run XS tests | |
run: | | |
PATH=$PATH:$GITHUB_WORKSPACE/moddable/build/bin/lin/debug | |
yarn lerna run test:xs | |
working-directory: endo |
if: steps.check-release.outputs.release == 'build' | ||
working-directory: moddable/xs/makefiles/lin | ||
run: | | ||
make debug MODDABLE=$GITHUB_WORKSPACE/moddable CC='cc "-D__has_builtin(x)=1"' # give the syntax highlighter a hand: ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make debug MODDABLE=$GITHUB_WORKSPACE/moddable CC='cc "-D__has_builtin(x)=1"' # give the syntax highlighter a hand: ' | |
make debug MODDABLE=$GITHUB_WORKSPACE/moddable CC='cc "-D__has_builtin(x)=1"' # here's a nickle, kid... go get yourself a better syntax highlighter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And that’s the difference between giving your 2¢ and giving your 5¢.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved in principle, I'll let you decide whether to entertain my further suggestions.
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed I was suggesting for them to be siblings.
.github/workflows/ci.yml
Outdated
if: steps.check-release.outputs.release == 'download' | ||
working-directory: .. | ||
run: | | ||
BINDIR=$GITHUB_WORKSPACE/moddable/build/bin/lin/debug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little uncertain about downloading the binary to the output of the compilation. Have you considered making a generic $GITHUB_WORKSPACE/bin
and downloading the binary there. For the compile version we can simply copy the compiled binary there, and even blow away the checked out folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered both and flipped a coin. But, so long as I’m making endo
and moddable
peers under the workspace, I may as well make a bin
peer.
.github/workflows/ci.yml
Outdated
- name: Choose download or build | ||
id: check-release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you seem to be entertaining my suggestions, here is another one: use actions/cache to cache the binary (downloaded or compiled) based on the version.
Something like:
- name: Choose download or build | |
id: check-release | |
- name: Restore XS binary | |
id: restore-xs-release | |
uses: actions/cache@v4 | |
with: | |
path: bin/xst | |
key: xst-lin64-${{ matrix.moddable-version }} | |
- name: Choose download or build | |
id: check-release | |
if: steps.restore-xs-release.outputs.cache-hit != 'true' |
(assuming we copied the binary to $GITHUB_WORKSPACE/bin/xst
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very much entertaining suggestions. If you have a suggestion that would parameterize the architecture, that’ll make it easier to turn on darwin and the holes-in-sides-of-houses variants in CI maybe someday.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are, but not sure which are effectively needed, since GH cache is supposed to be different by default based on the OS (see enableCrossOsArchive
). Here is an example in agoric-sdk:
${{ runner.os }}-${{ runner.arch }}
A relevant PR/commit might be Agoric/agoric-sdk@c9222a9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record, I’ve got a good idea of how to add platforms to the matrix and am electing not to at this juncture.
f5d92c0
to
b9a8180
Compare
92f62ea
to
21d4275
Compare
Refs: #2463, #2252 ## Description In #2463 we introduced ModuleSource to the SES permits, but this interacted catastrophically with the native XS ModuleSource. We reverted this change #2468 to unbreak Agoric SDK integration. This change reintroduces the ModuleSource permits, such that they are compatible with both XS and the `@endo/module-source/shim.js`, which anticipates the introduction of an AbstractModuleSource base class. Because SES can more gracefully tolerate the absence of an permitted [[Proto]] than the presence of a non-permitted [[Proto]], this adjusts the shim to ensure that the AbstractModuleSource shape exists as a side-effect of repairs/taming, before permits are applied. ### Security Considerations Increase in memory safety exposure in native code implementation of ModuleSource where applicable. ### Scaling Considerations None. ### Documentation Considerations This change reintroduces a note in NEWS.md for the next release. ### Testing Considerations The prior regression went unnoticed because we did not yet have CI for XS #2465. With this change, `yarn test:xs` in SES validates the shim on XS. We also test `@endo/module-source/shim.js` in `ses/test/module-source.test.js` on Node.js. ### Compatibility Considerations This change is designed to tolerate either path forward for the language, whether or not it accepts an AbstractModuleSource base class. ### Upgrade Considerations None.
@leotm This can be used as a template for making a CI job that will run |
Refs: #2254
Description
Rigs CI to run tests with
xst
. We can elaborate on this with a broader XS version vector and add XS tests to packages. This is in anticipation of a new harness262 package that will needxst
in CI.