mirror of
https://github.com/cryptoadvance/specter-desktop.git
synced 2026-08-13 12:33:29 +02:00
ci: upgrade Node.js 12→18, migrate CI images to GHCR (#2602)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
50d81434a8
commit
3e277689ef
9 changed files with 52 additions and 35 deletions
15
.cirrus.yml
15
.cirrus.yml
|
|
@ -2,7 +2,7 @@ container:
|
|||
# image: python:slim
|
||||
# image: ubuntu:jammy
|
||||
# image: python:3.10
|
||||
image: registry.gitlab.com/cryptoadvance/specter-desktop/cirrus-jammy:20230206
|
||||
image: ghcr.io/cryptoadvance/specter-desktop/cirrus-jammy:20260412
|
||||
|
||||
# We assume here that we're having a proper python3 system including virtualenv and pip
|
||||
prep_stuff_template: &PREP_STUFF_TEMPLATE
|
||||
|
|
@ -70,11 +70,16 @@ test_task:
|
|||
|
||||
|
||||
cypress_test_task:
|
||||
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
|
||||
skip: "false"
|
||||
container:
|
||||
image: registry.gitlab.com/cryptoadvance/specter-desktop/cypress-python-jammy:20230206
|
||||
cpu: 6
|
||||
memory: 6G
|
||||
persistent_worker:
|
||||
labels:
|
||||
os: linux
|
||||
isolation:
|
||||
container:
|
||||
image: ghcr.io/cryptoadvance/specter-desktop/cypress-python-jammy:20260411
|
||||
cpu: 6
|
||||
memory: 6G
|
||||
pre_prep_script:
|
||||
# The stupid old debian-package is not installing a proper binary but just the python-package
|
||||
- echo -e '#!/bin/bash\npython3 -m virtualenv "$@"' > /usr/local/bin/virtualenv
|
||||
|
|
|
|||
|
|
@ -67,11 +67,17 @@ describe('Test the actions in UTXO list', () => {
|
|||
cy.get('tx-table').find('tx-row').eq(0).find('.select-tx-img').click( {position: 'top'} )
|
||||
cy.wait(100)
|
||||
cy.get('tx-table').find('.freeze-tx-btn').click()
|
||||
cy.wait(200)
|
||||
// freeze-tx-btn submits a form → full page nav. tx-table's render()
|
||||
// awaits fetchWalletData() before attaching txRowSelected listeners,
|
||||
// so on fast workers a click can land after tx-row creation but
|
||||
// before the listener is live — select-tx-value toggles but the
|
||||
// action box never reveals. Wait long enough for the async gap to close.
|
||||
cy.wait(1000)
|
||||
// Select it
|
||||
cy.get('tx-table').find('tx-row').eq(0).find('.select-tx-img').click( {position: 'top'} );
|
||||
cy.get('tx-table').find('tx-row').eq(0).find('.select-tx-value').invoke('attr', 'value').should('eq', 'true') // Check that the click flow is (still) in order
|
||||
cy.wait(200)
|
||||
// Wait for the tx-table listener to process the selection and reveal the action box.
|
||||
cy.get('tx-table').find('.selected-rows-action-box').should('not.have.class', 'hidden')
|
||||
cy.get('tx-table').find('.compose-tx-btn').click()
|
||||
// Switch to coin selection, check that the right amount of coins are preselected in the coin selection
|
||||
cy.get('.coinselect-hidden').should('have.length', 1);
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ An image used to run the build on cirrus (tests only, not cypress-tests).
|
|||
Create it like this:
|
||||
|
||||
```
|
||||
docker build . -t registry.gitlab.com/cryptoadvance/specter-desktop/cirrus-jammy:20230206
|
||||
docker push registry.gitlab.com/cryptoadvance/specter-desktop/cirrus-jammy:20230206
|
||||
docker buildx build --platform linux/amd64 -t ghcr.io/cryptoadvance/specter-desktop/cirrus-jammy:20260412 --load .
|
||||
docker push ghcr.io/cryptoadvance/specter-desktop/cirrus-jammy:20260412
|
||||
```
|
||||
|
||||
Check the `.cirrus.yml` on how this is used and update the $current_date there.
|
||||
|
|
|
|||
|
|
@ -1,15 +1,20 @@
|
|||
FROM ubuntu:22.04
|
||||
|
||||
# avoid any prompts
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install Node.js 18.x from NodeSource (Ubuntu apt ships 12.x which lacks optional chaining)
|
||||
RUN apt-get update && \
|
||||
apt-get install -y apt-transport-https curl nodejs npm
|
||||
apt-get install -y apt-transport-https curl ca-certificates gnupg && \
|
||||
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
|
||||
apt-get install -y nodejs
|
||||
|
||||
|
||||
# Install latest NPM and Yarn
|
||||
RUN npm install -g npm@latest
|
||||
# Install latest Yarn
|
||||
RUN npm install -g yarn@latest
|
||||
|
||||
# install additional native dependencies build tools
|
||||
RUN apt install -y build-essential
|
||||
# apt-get update needed again after NodeSource setup script modified sources
|
||||
RUN apt-get update && apt-get install -y build-essential
|
||||
|
||||
# install Git client
|
||||
RUN apt-get install -y git
|
||||
|
|
@ -17,8 +22,6 @@ RUN apt-get install -y git
|
|||
# https://github.com/cypress-io/cypress/releases/tag/v3.8.0
|
||||
RUN apt-get install -y unzip
|
||||
|
||||
# avoid any prompts
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
#install tzdata package
|
||||
RUN apt-get install -y tzdata
|
||||
# set your timezone
|
||||
|
|
@ -40,11 +43,11 @@ RUN apt-get install -y \
|
|||
|
||||
# a few environment variables to make NPM installs easier
|
||||
# good colors for most applications
|
||||
ENV TERM xterm
|
||||
ENV TERM=xterm
|
||||
# avoid million NPM install messages
|
||||
ENV npm_config_loglevel warn
|
||||
ENV npm_config_loglevel=warn
|
||||
# allow installing when the main user is root
|
||||
ENV npm_config_unsafe_perm true
|
||||
ENV npm_config_unsafe_perm=true
|
||||
|
||||
# versions of local tools
|
||||
RUN echo " node version: $(node -v) \n" \
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ A base-image used in cypress-python to use a newer ubuntu jammy rather than a bu
|
|||
Create it like this:
|
||||
|
||||
```
|
||||
docker build . -t registry.gitlab.com/cryptoadvance/specter-desktop/cypress-base-ubuntu-jammy:20220908
|
||||
docker push registry.gitlab.com/cryptoadvance/specter-desktop/cypress-base-ubuntu-jammy:20220908
|
||||
docker build . -t ghcr.io/cryptoadvance/specter-desktop/cypress-base-ubuntu-jammy:20260411
|
||||
docker push ghcr.io/cryptoadvance/specter-desktop/cypress-base-ubuntu-jammy:20260411
|
||||
```
|
||||
|
||||
used in cypress-python
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
FROM registry.gitlab.com/cryptoadvance/specter-desktop/cypress-base-ubuntu-jammy:20220908
|
||||
FROM ghcr.io/cryptoadvance/specter-desktop/cypress-base-ubuntu-jammy:20260411
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
python3-pip python3-virtualenv zip unzip file apt libusb-1.0-0-dev libudev-dev \
|
||||
|
|
@ -17,4 +17,4 @@ RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends
|
|||
WORKDIR /test
|
||||
RUN rm -rf node_modules package-lock.json ~/.cache/Cypress
|
||||
RUN npm install --save-dev cypress@9.7.0
|
||||
RUN $(npm bin)/cypress verify
|
||||
RUN npx --no-install cypress verify
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ An image, ready to be used with cypress but also provides all the dependencies w
|
|||
Use versions of cypress as the version part of the tag. So e.g.:
|
||||
|
||||
```
|
||||
docker build . -t registry.gitlab.com/cryptoadvance/specter-desktop/cypress-python-jammy:20230206
|
||||
docker push registry.gitlab.com/cryptoadvance/specter-desktop/cypress-python-jammy:20230206
|
||||
docker build . -t ghcr.io/cryptoadvance/specter-desktop/cypress-python-jammy:20260411
|
||||
docker push ghcr.io/cryptoadvance/specter-desktop/cypress-python-jammy:20260411
|
||||
```
|
||||
|
||||
Search for `cypress-python` on where this is used in the project.
|
||||
|
|
|
|||
|
|
@ -33,5 +33,8 @@
|
|||
"bugs": {
|
||||
"url": "https://github.com/cryptoadvance/specter-desktop/issues"
|
||||
},
|
||||
"homepage": "https://github.com/cryptoadvance/specter-desktop#readme"
|
||||
"homepage": "https://github.com/cryptoadvance/specter-desktop#readme",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ function check_consistency {
|
|||
fi
|
||||
done <<< "$GREP_OUTPUT"
|
||||
fi
|
||||
$(npm bin)/cypress verify
|
||||
npx cypress verify
|
||||
}
|
||||
|
||||
check_consistency
|
||||
|
|
@ -211,7 +211,7 @@ function start_specter {
|
|||
# Simulate slower machines with uncommenting this (-l 10 means using 10% cpu):
|
||||
#cpulimit -p $specter_pid -l 10 -b
|
||||
echo "--> Waiting for specter ..."
|
||||
$(npm bin)/wait-on http://127.0.0.1:${PORT} && echo "--> Success"
|
||||
npx wait-on http://127.0.0.1:${PORT} && echo "--> Success"
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -323,7 +323,7 @@ function sub_open {
|
|||
start_elementsd --reset
|
||||
start_specter --reset
|
||||
fi
|
||||
$(npm bin)/cypress open
|
||||
npx cypress open
|
||||
}
|
||||
|
||||
function sub_run {
|
||||
|
|
@ -334,14 +334,14 @@ function sub_run {
|
|||
start_elementsd
|
||||
start_specter
|
||||
# Run $spec_file and all of the others coming later!
|
||||
#$(npm bin)/cypress run --spec $(./utils/calc_cypress_test_spec.py --run $spec_file)
|
||||
#npx cypress run --spec $(./utils/calc_cypress_test_spec.py --run $spec_file)
|
||||
# Run $spec_file and only that spec-file!
|
||||
$(npm bin)/cypress run --spec ./cypress/integration/${spec_file}
|
||||
npx cypress run --spec ./cypress/integration/${spec_file}
|
||||
else
|
||||
start_bitcoind --reset
|
||||
start_elementsd --reset
|
||||
start_specter --reset
|
||||
$(npm bin)/cypress run
|
||||
npx cypress run
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
@ -349,8 +349,8 @@ function sub_basics {
|
|||
start_bitcoind --reset
|
||||
start_elementsd --reset
|
||||
start_specter --reset
|
||||
$(npm bin)/cypress run --spec $(./utils/cypress_basics.py) --config video=false
|
||||
$(npm bin)/cypress open
|
||||
npx cypress run --spec $(./utils/cypress_basics.py) --config video=false
|
||||
npx cypress open
|
||||
}
|
||||
|
||||
function sub_snapshot {
|
||||
|
|
@ -364,7 +364,7 @@ function sub_snapshot {
|
|||
start_bitcoind --reset
|
||||
start_elementsd --reset
|
||||
start_specter --reset
|
||||
$(npm bin)/cypress run --spec $(./utils/calc_cypress_test_spec.py $spec_file)
|
||||
npx cypress run --spec $(./utils/calc_cypress_test_spec.py $spec_file)
|
||||
echo "--> stopping specter"
|
||||
stop_specter
|
||||
echo "--> stopping bitcoind gracefully ... won't take long ..."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue