Skip to content

Commit

Permalink
fixup new branched workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Sep 24, 2024
1 parent 061240f commit 2ed5693
Showing 1 changed file with 46 additions and 68 deletions.
114 changes: 46 additions & 68 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 @@ -271,12 +271,15 @@ jobs:
fail-fast: false
matrix:
node-version: [20.x]
moddable-version: [5.0.0]
# Including one of each category, named release and git ref, to ensure
# we support both cases for the duration of the PR that introduces this
# CI job.
moddable-version: [5.0.0, 1f49b61d52987bce8d430ac2fe1fab5365bc2043]
platform: [ubuntu-latest]

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

# without this, setup-node errors on mismatched yarn versions
- run: corepack enable
Expand All @@ -295,71 +298,46 @@ jobs:
- name: Run yarn build
run: yarn build

- name: Get XS
- name: Choose download or build
id: check-release
run: |
wget https://github.com/Moddable-OpenSource/moddable/releases/download/${{ matrix.moddable-version }}/xst-lin64.zip
mkdir -p bin
unzip xst-lin64.zip -d bin
chmod 755 bin/xst
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: Is this thing on?
- name: Build XS
if: steps.check-release.outputs.release == 'build'
working-directory: moddable/xs/makefiles/lin
run: |
PATH=$PATH:$GITHUB_WORKSPACE/bin
make debug MODDABLE=$GITHUB_WORKSPACE/moddable CC='cc "-D__has_builtin(x)=1"' # give the syntax highlighter a hand: '
- name: Validate XS Build or Download
run: |
PATH=$PATH:$GITHUB_WORKSPACE/moddable/build/bin/lin/debug
xst -e true && ! xst -e null.reference
- name: Run XS tests
run: |
PATH=$PATH:$GITHUB_WORKSPACE/bin
PATH=$PATH:$GITHUB_WORKSPACE/moddable/build/bin/lin/debug
yarn lerna run test:xs
# for testing a version with a particular hash, when pre-built binaries are unavailable
# make-and-test-xs:
# name: make-and-test-xs
#
# # begin macro
#
# runs-on: ${{ matrix.platform }}
# strategy:
# fail-fast: false
# matrix:
# moddable-version: []
# node-version: [20.x]
# platform: [ubuntu-latest]
#
# steps:
# - name: Checkout
# uses: actions/checkout@v3
#
# # 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: Clone XS
# run: git clone https://github.com/moddable-OpenSource/moddable --branch "${{ matrix.moddable-version }}" --depth 1
#
# - name: Build XS
# 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: Is this thing on?
# run: |
# PATH=$PATH:$GITHUB_WORKSPACE/moddable/build/bin/lin/debug
# xst -e true && ! xst -e null.reference
#
# - name: Run XS tests
# run: |
# PATH=$PATH:$GITHUB_WORKSPACE/moddable/build/bin/lin/debug
# yarn lerna run test:xs

0 comments on commit 2ed5693

Please sign in to comment.