feat: update CI #9
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: master pre-merge check | |
on: | |
push: | |
branches: | |
- master | |
- stable_v* | |
pull_request: | |
branches: | |
- master | |
- stable_v* | |
env: | |
CMAKE_BUILD_PARALLEL_LEVEL: 4 | |
GITHUB_ELEMENTS_VERSION: v0.2.5 | |
GITHUB_BITCOIN_VERSION: v0.2.5 | |
GITHUB_DOCKER_IMAGE: ghcr.io/cryptogarageinc/elements-testing | |
ELEMENTS_ENTRYPOINT_PATH: /github/workspace/.github/workflows/docker/test_entrypoint.sh | |
BITCOIN_ENTRYPOINT_PATH: /github/workspace/.github/workflows/docker/test_bitcoin_entrypoint.sh | |
jobs: | |
cmake-js-build: | |
name: cmake-js build | |
timeout-minutes: 50 | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-13, macos-15, windows-2022, ubuntu-22.04] | |
node: [20, 22] | |
exclude: | |
- os: macos-13 | |
node: 20 | |
- os: macos-15 | |
node: 20 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
timeout-minutes: 2 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: 'npm' | |
cache-dependency-path: package-lock.json | |
- name: update to npm v8 | |
run: npm i -g npm@8 | |
- name: dump node version | |
id: node_ver | |
run: | | |
export node_ver="$(node --version)" | |
echo "node_version=$node_ver" >> $GITHUB_OUTPUT | |
echo "node_version=$node_ver" | |
shell: bash | |
- name: node_modules-useCache | |
uses: actions/cache@v4 | |
id: node_cache | |
with: | |
path: node_modules | |
key: node-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-${{ hashFiles('**/package-lock.json') }}-0 | |
restore-keys: node-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-${{ hashFiles('package-lock.json') }}- | |
- name: npm info | |
if: steps.node_cache.outputs.cache-hit != 'true' | |
id: npm_info | |
run: | | |
npm --version | |
echo "temp_npm_cachedir=$(npm config get cache)" >> $GITHUB_OUTPUT | |
- name: npm_install | |
if: steps.node_cache.outputs.cache-hit != 'true' | |
env: | |
CFDJS_UNUSE_ASSET: true | |
run: | | |
npm set progress=false | |
npm ci | |
- name: build | |
if: steps.node_cache.outputs.cache-hit == 'true' | |
run: npm run cmake_release_parallel | |
- name: test_all | |
run: npm run test | |
- name: example | |
run: npm run example | |
- name: elements_example | |
run: npm run elements_example | |
- name: lint_check | |
if: runner.os != 'macOS' | |
run: npm run lint_all | |
- name: after_job | |
run: rm -rf node_modules/cfd-js | |
shell: bash | |
continue-on-error: true | |
bitcoin-e2e-test: | |
name: bitcoin e2e test | |
runs-on: ubuntu-24.04 | |
timeout-minutes: 30 | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Login GitHub Registry | |
run: docker login docker.pkg.github.com -u owner -p ${{ secrets.GITHUB_TOKEN }} | |
- name: Pull image from GitHub Registry | |
run: docker pull ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_BITCOIN_VERSION }} | |
- name: integration test | |
run: | | |
docker run -u root -v ${{ github.workspace }}:/github/workspace --entrypoint ${{ env.BITCOIN_ENTRYPOINT_PATH }} ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_BITCOIN_VERSION }} | |
elements-e2e-test: | |
name: elements e2e test | |
runs-on: ubuntu-24.04 | |
timeout-minutes: 40 | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Login GitHub Registry | |
run: docker login docker.pkg.github.com -u owner -p ${{ secrets.GITHUB_TOKEN }} | |
- name: Pull image from GitHub Registry | |
run: docker pull ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_ELEMENTS_VERSION }} | |
- name: integration test | |
run: | | |
docker run -u root -v ${{ github.workspace }}:/github/workspace --entrypoint ${{ env.ELEMENTS_ENTRYPOINT_PATH }} ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_ELEMENTS_VERSION }} | |
doxygen-ubuntu: | |
name: doxygen-ubuntu | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install_doxygen | |
run: sudo apt install doxygen graphviz | |
- name: doxygen_check | |
run: | | |
cd doc | |
doxygen Doxyfile_quiet_all |