Skip to content

Commit

Permalink
test: Introduce XS CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Sep 24, 2024
1 parent c101168 commit 51b25fd
Showing 1 changed file with 80 additions and 6 deletions.
86 changes: 80 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

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

# without this, setup-node errors on mismatched yarn versions
- run: corepack enable
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:

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

# without this, setup-node errors on mismatched yarn versions
- run: corepack enable
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:

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

# without this, setup-node errors on mismatched yarn versions
- run: corepack enable
Expand Down Expand Up @@ -158,7 +158,7 @@ jobs:

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

# without this, setup-node errors on mismatched yarn versions
- run: corepack enable
Expand Down Expand Up @@ -194,7 +194,7 @@ jobs:

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

# without this, setup-node errors on mismatched yarn versions
- run: corepack enable
Expand Down Expand Up @@ -230,7 +230,7 @@ jobs:

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

# without this, setup-node errors on mismatched yarn versions
- run: corepack enable
Expand Down Expand Up @@ -260,3 +260,77 @@ jobs:
# when imported in an NPM node_modules tree.
- name: Prepack packages
run: yarn lerna run --reject-cycles --concurrency 1 prepack

test-xs:
name: test-xs

# begin macro

runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
node-version: [20.x]
# may include release tags and hashes:
moddable-version: [5.0.0]
platform: [ubuntu-latest]

steps:
- name: Checkout
uses: actions/checkout@v4

# without this, setup-node errors on mismatched yarn versions
- run: corepack enable

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: yarn

- name: Install dependencies
run: yarn install --immutable

# end macro

- name: Run yarn build
run: yarn build

- name: Choose download or build
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=download
else
echo release=build
fi >> $GITHUB_OUTPUT
- name: Download XS
if: steps.check-release.outputs.release == 'download'
working-directory: ..
run: |
BINDIR=$GITHUB_WORKSPACE/moddable/build/bin/lin/debug
wget "https://github.com/Moddable-OpenSource/moddable/releases/download/${{ matrix.moddable-version }}/xst-lin64.zip"
mkdir -p "$BINDIR"
unzip xst-lin64.zip -d "$BINDIR"
chmod 755 "$BINDIR/xst"
- name: Checkout XS
if: steps.check-release.outputs.release == 'build'
uses: actions/checkout@v4
with:
repository: moddable-OpenSource/moddable
ref: ${{ matrix.moddable-version }}
path: moddable

- name: Build XS
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: '
- name: Run XS tests
run: |
PATH=$PATH:$GITHUB_WORKSPACE/moddable/build/bin/lin/debug
yarn lerna run test:xs

0 comments on commit 51b25fd

Please sign in to comment.