Skip to content
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

Try to run emulated smoke tests for Linux environments #5477

Merged
merged 29 commits into from
Apr 20, 2024
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a0537ad
Try adding initial config for ppc64le
lukastaegert Apr 19, 2024
062eaf2
Comment out any parts of the pipeline we are not working on
lukastaegert Apr 19, 2024
12b68b8
Try to install NodeJS and attempt a bootstrap build
lukastaegert Apr 19, 2024
a84ecc6
Move smoke test to separate step with longer timeout
lukastaegert Apr 19, 2024
baf1c88
Add additional targets to smoke tests
lukastaegert Apr 19, 2024
b36c4bd
Try wget over curl
lukastaegert Apr 19, 2024
f843a55
Separate build for Alpine
lukastaegert Apr 19, 2024
212828f
Add logging
lukastaegert Apr 19, 2024
b909e10
Fix Rollup installation
lukastaegert Apr 19, 2024
419f4e0
Use correct path for native artifact
lukastaegert Apr 19, 2024
fdc4ff0
Install plugin
lukastaegert Apr 19, 2024
196d2c8
Correctly hand over js artifact
lukastaegert Apr 19, 2024
ea8dc53
Make binary executable
lukastaegert Apr 19, 2024
9b701ca
Enable caching
lukastaegert Apr 19, 2024
8d9d6a0
Add missing types
lukastaegert Apr 19, 2024
6090694
Also install rollup
lukastaegert Apr 19, 2024
4ffe0ac
Display versions after nvm
lukastaegert Apr 19, 2024
4611e6c
Add more logging
lukastaegert Apr 19, 2024
9c2dd18
Install all dependencies after all
lukastaegert Apr 19, 2024
75b986e
Fix bashrc path
lukastaegert Apr 19, 2024
02a3c75
Run nvm during run script
lukastaegert Apr 19, 2024
cb28c5e
Also add git
lukastaegert Apr 19, 2024
e833c66
Try apt-get again
lukastaegert Apr 19, 2024
086f041
Re-introduce optional nvm
lukastaegert Apr 19, 2024
8ef33f7
Fix nvm install
lukastaegert Apr 19, 2024
06f5175
Go back to previous way of installing nvm
lukastaegert Apr 19, 2024
1e7fd00
Unskip most things and add test that hopefully fails
lukastaegert Apr 19, 2024
a272032
Add safe directory to silence warning
lukastaegert Apr 20, 2024
bd1b44b
Install dependencies in smoke tests and build JS locally
lukastaegert Apr 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
97 changes: 96 additions & 1 deletion .github/workflows/build-and-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,100 @@ jobs:
if-no-files-found: error
if: ${{ !matrix.settings.is-wasm-build }}

# smoke test for some architectures that do not receive the full test suite
smoke-test:
permissions:
packages: write # for caching container images
name: Smoke Test ${{ matrix.settings.target }}
needs:
- build
strategy:
fail-fast: false
matrix:
settings:
- arch: aarch64
distro: ubuntu_latest
target: aarch64-unknown-linux-gnu
- arch: aarch64
distro: alpine_latest
target: aarch64-unknown-linux-musl
- arch: armv7
distro: ubuntu_latest
target: armv7-unknown-linux-gnueabihf
# There is a bug that hangs the build when running npm
# - arch: armv7
# distro: alpine_latest
# target: armv7-unknown-linux-musleabihf
- arch: ppc64le
distro: ubuntu_latest
target: powerpc64le-unknown-linux-gnu
use-nvm: true
- arch: s390x
distro: ubuntu_latest
target: s390x-unknown-linux-gnu
use-nvm: true
# I could not find a way to install Node without compiling from source
# - arch: riscv64
# distro: ubuntu_latest
# target: riscv64gc-unknown-linux-gnu
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- name: Checkout Commit
uses: actions/checkout@v4
- name: Cache Node Modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci --ignore-scripts
- name: Build JS
run: npm run build:cjs
- name: Download napi artifacts
uses: actions/download-artifact@v4
with:
name: bindings-${{ matrix.settings.target }}
path: dist/
- name: Run Smoke Test
uses: uraimo/run-on-arch-action@v2
with:
arch: ${{ matrix.settings.arch }}
distro: ${{ matrix.settings.distro }}
githubToken: ${{ github.token }}
install: |
case "${{ matrix.settings.distro }}" in
ubuntu*)
apt-get update -y
apt-get install -y curl git
if [[ -z "${{ matrix.settings.use-nvm }}" ]]; then
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
apt-get install -y nodejs
fi
;;
alpine*)
apk add nodejs npm git
;;
esac
run: |
set -e
if [[ -n "${{ matrix.settings.use-nvm }}" ]]; then
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
source ~/.nvm/nvm.sh
nvm install --lts
fi
echo "Node: $(node -v)"
echo "npm: $(npm -v)"
git config --global --add safe.directory /home/runner/work/rollup/rollup
chmod +x dist/bin/rollup
dist/bin/rollup --version | grep -E 'rollup v[0-9]+\.[0-9]+\.[0-9]+'
mv dist dist-build
node dist-build/bin/rollup --config rollup.config.ts --configPlugin typescript --configTest --forceExit
cp dist-build/rollup.*.node dist/
dist/bin/rollup --version | grep -E 'rollup v[0-9]+\.[0-9]+\.[0-9]+'

test:
name: Test${{ matrix.additionalName || '' }} Node ${{ matrix.node }} (${{ matrix.settings.target }})
needs:
Expand Down Expand Up @@ -349,8 +443,9 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 15
needs:
- test
- lint
- test
- smoke-test
# This needs to be adapted for Rollup 5
if: startsWith(github.ref_name, 'v4')
steps:
Expand Down