fix(datastore): tests broken from argon updates #991
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.23' | |
- name: Install pcap | |
run: sudo apt-get install -y libpcap-dev | |
- name: Clone Mainchain | |
run: | | |
git clone --depth 1 -b napi-bindings https://github.com/argonprotocol/mainchain.git | |
cp mainchain/localchain/npm/**/*.node mainchain/localchain | |
working-directory: .. | |
- name: Install mainchain | |
run: yarn | |
working-directory: ../mainchain | |
- name: Install Mainchain client | |
run: yarn tsc | |
working-directory: ../mainchain/client/nodejs | |
- name: Clone Hero | |
run: | | |
git clone -n --recurse-submodules https://github.com/ulixee/hero.git | |
cd hero | |
(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 Hero | |
run: yarn build | |
working-directory: ../hero | |
- name: Set yarn config | |
run: yarn config set ignore-engines true && yarn config set frozen-lockfile true | |
- name: Yarn build | |
run: yarn build | |
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.23' | |
- uses: actions/setup-python@v5 | |
if: ${{ matrix.os != 'windows-latest' }} | |
with: | |
python-version: '3.10' | |
- 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: Clear space | |
if: ${{ matrix.os == 'macos-latest' }} | |
run: | | |
sudo rm -rf /Users/runner/Library/Android/sdk | |
sudo rm -rf /Users/runner/hostedtoolcache/CodeQL | |
sudo rm -rf /Users/runner/Library/Developer/CoreSimulator | |
sudo rm -rf /Users/runner/Library/Developer/Xcode/DerivedData | |
sudo rm -rf /Users/runner/Library/Developer/Xcode/iOS DeviceSupport | |
sudo rm -rf /Users/runner/Library/Developer/Xcode/watchOS DeviceSupport | |
- name: Clone Mainchain | |
shell: bash | |
run: | | |
git clone -b napi-bindings https://github.com/argonprotocol/mainchain.git | |
cp mainchain/localchain/npm/**/*.node mainchain/localchain | |
working-directory: .. | |
- name: Install mainchain | |
run: yarn | |
working-directory: ../mainchain | |
- name: Install Mainchain client | |
run: yarn tsc | |
working-directory: ../mainchain/client/nodejs | |
- name: Clone Hero | |
run: | | |
git clone -n --recurse-submodules https://github.com/ulixee/hero.git | |
cd hero | |
(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 Hero | |
run: yarn build | |
working-directory: ../hero | |
- name: Install Deps | |
run: yarn config set ignore-engines true | |
- name: Yarn build | |
run: yarn build | |
env: | |
ELECTRON_SKIP_BINARY_DOWNLOAD: 1 | |
ULX_MITM_REBUILD_SOCKET: 0 | |
NODE_OPTIONS: --max_old_space_size=4096 | |
- 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 |