v2.0.0-alpha.29 #956
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Matrix | |
on: | |
push: | |
branches: | |
- '*' | |
- '!gh-pages' | |
pull_request: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint-and-test: | |
name: Test Node.js ${{ matrix.node-version }} on ubuntu-latest | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: [18, 20] | |
runs-on: ubuntu-latest | |
env: | |
SSH_PATH: ${{ github.workspace }}/.ssh | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_PASSWORD: postgres | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- name: /etc/hosts | |
run: | | |
sudo echo "127.0.0.1 host.docker.internal" | sudo tee -a /etc/hosts | |
shell: bash | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'yarn' | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.20' | |
- name: Install pcap | |
run: sudo apt-get install -y libpcap-dev | |
- name: Setup SSH for Git Operations | |
shell: bash | |
run: | | |
mkdir -p "$SSH_PATH" | |
echo "$SSH_PRIVATE_KEY" > "$SSH_PATH/id_rsa" | |
chmod 600 "$SSH_PATH/id_rsa" | |
ssh-keyscan github.com >> "$SSH_PATH/known_hosts" | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.MAINCHAIN_SSH_KEY }} | |
- name: Clone Mainchain | |
run: | | |
export GIT_SSH_COMMAND="ssh -i $SSH_PATH/id_rsa -o UserKnownHostsFile=$SSH_PATH/known_hosts" | |
git clone --depth 1 -b napi-bindings [email protected]:ulixee/mainchain.git | |
cp mainchain/localchain/npm/**/*.node mainchain/localchain | |
working-directory: .. | |
- name: Clone ulixee/shared | |
run: | | |
git clone -n https://github.com/ulixee/shared.git | |
cd shared | |
(git fetch --depth 1 origin $GITHUB_REF_NAME && git checkout $GITHUB_REF_NAME) || (git fetch --depth 1 origin main && git checkout main) | |
working-directory: .. | |
- name: Install ulixee/shared | |
run: yarn && yarn build | |
working-directory: ../shared | |
- name: Clone unblocked | |
run: | | |
git clone -n --recurse-submodules https://github.com/ulixee/unblocked.git | |
cd unblocked | |
(git fetch --depth 1 origin $GITHUB_REF_NAME && git checkout $GITHUB_REF_NAME) || (git fetch --depth 1 origin main && git checkout main) | |
git submodule update --init --recursive --depth 1 | |
working-directory: .. | |
- name: Install unblocked | |
run: yarn build | |
working-directory: ../unblocked | |
- name: Install mainchain | |
run: yarn | |
working-directory: ../mainchain | |
- name: Install Mainchain client | |
run: yarn tsc | |
working-directory: ../mainchain/client/nodejs | |
- name: Install Hero | |
run: yarn build | |
working-directory: ./hero | |
- name: Relink Shared | |
run: yarn build | |
working-directory: ../shared | |
- name: Yarn build | |
run: yarn --ignore-engines && yarn build --ignore-engines | |
env: | |
ELECTRON_SKIP_BINARY_DOWNLOAD: 1 | |
- name: Redo mainchain deps | |
run: yarn | |
working-directory: ../mainchain/client/nodejs | |
- name: Linux - Apt Install Chrome(s) | |
working-directory: ./build | |
run: sudo $(npx install-browser-deps) | |
- name: Run Lint | |
if: ${{ matrix.node-version == 18 }} | |
run: NODE_OPTIONS=--max-old-space-size=4096 yarn lint | |
- name: Run tests | |
run: yarn test --testTimeout=60000 --maxWorkers=2 | |
env: | |
ADD_DOCKER_HOST: true | |
ULX_USE_DOCKER_BINS: 1 | |
CI: true | |
- name: 'Tar files' | |
if: ${{ failure() }} | |
run: tar -cvf test-dbs.tar build/.data-test | |
- name: Upload Databases | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-dbs-${{matrix.os}}-${{ matrix.node-version }} | |
path: test-dbs.tar | |
retention-days: 1 | |
test: | |
name: Test Node.js ${{ matrix.node-version }} on ${{ matrix.os }} | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, windows-latest] | |
node-version: [18, 20] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'yarn' | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.20' | |
- name: Chocolatey Install Action | |
if: ${{ matrix.os == 'windows-latest' }} | |
uses: crazy-max/ghaction-chocolatey@v3 | |
with: | |
args: install python2 visualcpp-build-tools -y | |
- name: Add msbuild to PATH | |
if: ${{ matrix.os == 'windows-latest' }} | |
uses: microsoft/setup-msbuild@v2 | |
- name: Setup SSH for Git Operations | |
shell: bash | |
run: | | |
if [[ "$RUNNER_OS" == "Windows" ]]; then | |
SSH_PATH="$HOME/.ssh" | |
mkdir "$SSH_PATH" | |
echo "$SSH_PRIVATE_KEY" > "$SSH_PATH/id_rsa" | |
chmod 600 "$SSH_PATH/id_rsa" | |
ssh-keyscan github.com >> "$SSH_PATH/known_hosts" | |
echo "GIT_SSH_COMMAND=ssh -i $SSH_PATH/id_rsa -o UserKnownHostsFile=$SSH_PATH/known_hosts" >> $GITHUB_ENV | |
else | |
SSH_PATH=~/.ssh | |
mkdir -p "$SSH_PATH" | |
echo "$SSH_PRIVATE_KEY" > "$SSH_PATH/id_rsa" | |
chmod 600 "$SSH_PATH/id_rsa" | |
ssh-keyscan github.com >> "$SSH_PATH/known_hosts" | |
echo "GIT_SSH_COMMAND=ssh -i $SSH_PATH/id_rsa -o UserKnownHostsFile=$SSH_PATH/known_hosts" >> $GITHUB_ENV | |
fi | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.MAINCHAIN_SSH_KEY }} | |
- name: Clone Mainchain | |
shell: bash | |
run: | | |
git clone -b napi-bindings [email protected]:ulixee/mainchain.git | |
cp mainchain/localchain/npm/**/*.node mainchain/localchain | |
working-directory: .. | |
- name: Clone ulixee/shared | |
shell: bash | |
run: | | |
git clone -n https://github.com/ulixee/shared.git | |
cd shared | |
(git fetch --depth 1 origin $GITHUB_REF_NAME && git checkout $GITHUB_REF_NAME) || (git fetch --depth 1 origin main && git checkout main) | |
working-directory: .. | |
- name: Install ulixee/shared | |
run: yarn && yarn build | |
working-directory: ../shared | |
- name: Clone unblocked | |
shell: bash | |
run: | | |
git clone -n --recurse-submodules https://github.com/ulixee/unblocked.git | |
cd unblocked | |
(git fetch --depth 1 origin $GITHUB_REF_NAME && git checkout $GITHUB_REF_NAME) || (git fetch --depth 1 origin main && git checkout main) | |
git submodule update --init --recursive --depth 1 | |
working-directory: .. | |
- name: Install unblocked | |
run: yarn build | |
working-directory: ../unblocked | |
- name: Install mainchain | |
run: yarn | |
working-directory: ../mainchain | |
- name: Install Mainchain client | |
run: yarn tsc | |
working-directory: ../mainchain/client/nodejs | |
- name: Install Hero | |
run: yarn build | |
working-directory: ./hero | |
- name: Relink Shared | |
run: yarn build | |
working-directory: ../shared | |
- name: Yarn build | |
run: yarn --ignore-engines && yarn build --ignore-engines | |
env: | |
ELECTRON_SKIP_BINARY_DOWNLOAD: 1 | |
- name: Redo mainchain deps | |
run: yarn | |
working-directory: ../mainchain/client/nodejs | |
- name: Run tests | |
run: yarn test --testTimeout=60000 --maxWorkers=2 | |
env: | |
SKIP_E2E: true | |
CI: true | |
ULX_DATASTORE_TMP_DIR: ${{ github.workspace }}/build/.data-test-tmp | |
- name: 'Tar files' | |
if: ${{ failure() }} | |
run: tar -cvf test-dbs.tar build/.data-test | |
- name: Upload Databases | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-dbs-${{matrix.os}}-${{ matrix.node-version }} | |
path: test-dbs.tar | |
retention-days: 1 |