Skip to content

Commit

Permalink
fix: update github actions (20230710) (#42)
Browse files Browse the repository at this point in the history
* fix: update github actions (20230710)

* fix: rollback elements-testing version

* test: fix elements script
  • Loading branch information
k-matsuzawa authored Jul 10, 2023
1 parent fc4e0c6 commit 91595a0
Show file tree
Hide file tree
Showing 9 changed files with 296 additions and 210 deletions.
75 changes: 33 additions & 42 deletions .github/workflows/check_pre-merge_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ on:

env:
CMAKE_BUILD_PARALLEL_LEVEL: 4
IMAGE_NODE_VERSION: 14
GITHUB_ELEMENTS_VERSION: v0.0.10
GITHUB_BITCOIN_VERSION: v0.0.10
GITHUB_DOCKER_IMAGE: docker.pkg.github.com/cryptogarageinc/elements-testing-dockerfile/elements-testing
GITHUB_ELEMENTS_VERSION: v0.2.3
GITHUB_BITCOIN_VERSION: v0.2.3
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

Expand All @@ -26,54 +25,44 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-10.15, windows-2019, ubuntu-18.04]
node: [12, 14, 16]
include:
- node: 12
always: false
- node: 14
always: false
- node: 16
always: true
os: [macos-11, windows-2019, ubuntu-20.04]
node: [16, 18, 19, 20]
exclude:
- os: macos-11
node: 14
- os: macos-11
node: 19

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
timeout-minutes: 1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
timeout-minutes: 2
with:
node-version: ${{ matrix.node }}
- name: update to npm v7
if: runner.os == 'Windows' || matrix.node == '16'
run: npm i -g npm@7
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 "::set-output name=node_version::$node_ver"
echo "node_version=$node_ver" >> $GITHUB_OUTPUT
echo "node_version=$node_ver"
shell: bash
- name: node_modules-useCache
uses: actions/cache@v1
uses: actions/cache@v3
id: node_cache
with:
path: node_modules
key: node-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: node-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-${{ hashFiles('**/package-lock.json') }}
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 "::set-output name=temp_npm_cachedir::$(npm config get cache)"
- name: use npm cache
if: runner.os != 'Windows' && steps.node_cache.outputs.cache-hit != 'true'
uses: actions/cache@v1
id: npm_cache
with:
path: ${{ steps.npm_info.outputs.temp_npm_cachedir }}
key: npm-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-0
restore-keys: |
npm-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-
echo "temp_npm_cachedir=$(npm config get cache)" >> $GITHUB_OUTPUT
- name: npm_install
if: steps.node_cache.outputs.cache-hit != 'true'
env:
Expand All @@ -82,7 +71,7 @@ jobs:
npm set progress=false
npm ci
- name: build
if: steps.node_cache.outputs.cache-hit == 'true' || ${{ matrix.always }} == 'true'
if: steps.node_cache.outputs.cache-hit == 'true'
run: npm run cmake_release_parallel
- name: test_all
run: npm run test
Expand All @@ -100,40 +89,42 @@ jobs:

bitcoin-e2e-test:
name: bitcoin e2e test
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
timeout-minutes: 30

steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- 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 -v ${{ github.workspace }}:/github/workspace --entrypoint ${{ env.BITCOIN_ENTRYPOINT_PATH }} ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_BITCOIN_VERSION }}
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-18.04
runs-on: ubuntu-22.04
timeout-minutes: 40

steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- 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 -v ${{ github.workspace }}:/github/workspace --entrypoint ${{ env.ELEMENTS_ENTRYPOINT_PATH }} ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_ELEMENTS_VERSION }}
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-18.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: install_doxygen
run: sudo apt install doxygen graphviz
- name: doxygen_check
Expand Down
75 changes: 33 additions & 42 deletions .github/workflows/check_pre-merge_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ on:

env:
CMAKE_BUILD_PARALLEL_LEVEL: 4
IMAGE_NODE_VERSION: 14
GITHUB_ELEMENTS_VERSION: v0.0.10
GITHUB_BITCOIN_VERSION: v0.0.10
GITHUB_DOCKER_IMAGE: docker.pkg.github.com/cryptogarageinc/elements-testing-dockerfile/elements-testing
GITHUB_ELEMENTS_VERSION: v0.1.0
GITHUB_BITCOIN_VERSION: v0.1.0
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

Expand All @@ -26,54 +25,44 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-10.15, windows-2019, ubuntu-18.04]
node: [12, 14, 16]
include:
- node: 12
always: false
- node: 14
always: false
- node: 16
always: true
os: [macos-11, windows-2019, ubuntu-20.04]
node: [16, 18, 19, 20]
exclude:
- os: macos-11
node: 14
- os: macos-11
node: 19

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
timeout-minutes: 1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
timeout-minutes: 2
with:
node-version: ${{ matrix.node }}
- name: update to npm v7
if: runner.os == 'Windows' || matrix.node == '16'
run: npm i -g npm@7
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 "::set-output name=node_version::$node_ver"
echo "node_version=$node_ver" >> $GITHUB_OUTPUT
echo "node_version=$node_ver"
shell: bash
- name: node_modules-useCache
uses: actions/cache@v1
uses: actions/cache@v3
id: node_cache
with:
path: node_modules
key: node-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: node-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-${{ hashFiles('**/package-lock.json') }}
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 "::set-output name=temp_npm_cachedir::$(npm config get cache)"
- name: use npm cache
if: runner.os != 'Windows' && steps.node_cache.outputs.cache-hit != 'true'
uses: actions/cache@v1
id: npm_cache
with:
path: ${{ steps.npm_info.outputs.temp_npm_cachedir }}
key: npm-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-0
restore-keys: |
npm-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-
echo "temp_npm_cachedir=$(npm config get cache)" >> $GITHUB_OUTPUT
- name: npm_install
if: steps.node_cache.outputs.cache-hit != 'true'
env:
Expand All @@ -82,7 +71,7 @@ jobs:
npm set progress=false
npm ci
- name: build
if: steps.node_cache.outputs.cache-hit == 'true' || ${{ matrix.always }} == 'true'
if: steps.node_cache.outputs.cache-hit == 'true'
run: npm run cmake_release_parallel
- name: test_all
run: npm run test
Expand All @@ -100,40 +89,42 @@ jobs:

bitcoin-e2e-test:
name: bitcoin e2e test
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
timeout-minutes: 30

steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- 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 -v ${{ github.workspace }}:/github/workspace --entrypoint ${{ env.BITCOIN_ENTRYPOINT_PATH }} ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_BITCOIN_VERSION }}
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-18.04
runs-on: ubuntu-22.04
timeout-minutes: 40

steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- 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 -v ${{ github.workspace }}:/github/workspace --entrypoint ${{ env.ELEMENTS_ENTRYPOINT_PATH }} ${{ env.GITHUB_DOCKER_IMAGE }}:${{ env.GITHUB_ELEMENTS_VERSION }}
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-18.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: install_doxygen
run: sudo apt install doxygen graphviz
- name: doxygen_check
Expand Down
Loading

0 comments on commit 91595a0

Please sign in to comment.