Skip to content

Commit 8b128bd

Browse files
authoredFeb 14, 2025
Merge pull request #17 from hyperweb-io/cicd
modify github action
2 parents 60f10f4 + 7ed2f59 commit 8b128bd

File tree

2 files changed

+49
-53
lines changed

2 files changed

+49
-53
lines changed
 

‎.github/workflows/run-tests-build.yaml

+28-30
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,34 @@ jobs:
1212
max-parallel: 4
1313
fail-fast: true
1414
matrix:
15-
example:
16-
[
17-
ibc-asset-list,
18-
vote-proposal,
19-
ibc-transfer,
20-
swap-tokens,
21-
provide-liquidity,
22-
connect-chain,
23-
connect-multi-chain,
24-
]
15+
include:
16+
- name: authz
17+
folder: examples
18+
- name: ibc-asset-list
19+
folder: examples
20+
- name: injective
21+
folder: examples
22+
- name: injective-vue
23+
folder: examples
24+
- name: stake-tokens
25+
folder: examples
26+
- name: vote-proposal
27+
folder: examples
28+
- name: chain-template
29+
folder: templates
30+
- name: connect-chain
31+
folder: templates
32+
- name: connect-multi-chain
33+
folder: templates
2534

2635
steps:
2736
- name: Checkout repository
2837
uses: actions/checkout@v4
2938

3039
- name: Set template_path Environment Variable
3140
run: |
32-
example_value="${{ matrix.example }}"
33-
34-
if [[ "$example_value" == "connect-chain" ]] || [[ "$example_value" == "connect-multi-chain" ]]; then
35-
echo "template_path=templates" >> $GITHUB_ENV
36-
echo "ci_template_path=dest" >> $GITHUB_ENV
37-
else
38-
echo "template_path=examples" >> $GITHUB_ENV
39-
echo "ci_template_path=dest" >> $GITHUB_ENV
40-
fi
41+
echo "template_path=${{ matrix.folder }}" >> $GITHUB_ENV
42+
echo "ci_template_path=dest" >> $GITHUB_ENV
4143
4244
- name: Log
4345
run: |
@@ -46,11 +48,10 @@ jobs:
4648
4749
- name: Clone example
4850
run: |
49-
echo "Cloning example: ./$template_path/${{ matrix.example }}/" into "${{ github.workspace }}/$ci_template_path/${{ matrix.example }}"
50-
51-
mkdir -p ${{ github.workspace }}/$ci_template_path/${{ matrix.example }}
52-
cp -r ./$template_path/${{ matrix.example }}/ ${{ github.workspace }}/$ci_template_path/
53-
cd ${{ github.workspace }}/$ci_template_path/${{ matrix.example }}
51+
echo "Cloning example: ./$template_path/${{ matrix.name }}/ into ${{ github.workspace }}/$ci_template_path/${{ matrix.name }}"
52+
mkdir -p ${{ github.workspace }}/$ci_template_path/${{ matrix.name }}
53+
cp -r ./$template_path/${{ matrix.name }}/ ${{ github.workspace }}/$ci_template_path/
54+
cd ${{ github.workspace }}/$ci_template_path/${{ matrix.name }}
5455
5556
- name: Set up Node.js
5657
uses: actions/setup-node@v4
@@ -69,17 +70,14 @@ jobs:
6970
with:
7071
path: |
7172
${{ github.workspace }}/.next/cache
72-
# Generate a new cache whenever packages or source files change.
73-
#key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
7473
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ env.DIFF_HASH }}
75-
# If source files changed but packages didn't, rebuild from a prior cache.
7674
restore-keys: |
7775
${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-
7876
7977
- name: Build example project
8078
run: |
81-
echo "Building example: ${{ matrix.example }} in directory ${{ github.workspace }}/$ci_template_path/${{ matrix.example }}"
82-
cd ${{ github.workspace }}/$ci_template_path/${{ matrix.example }}
79+
echo "Building example: ${{ matrix.name }} in directory ${{ github.workspace }}/$ci_template_path/${{ matrix.name }}"
80+
cd ${{ github.workspace }}/$ci_template_path/${{ matrix.name }}
8381
ls -la
8482
yarn install
85-
yarn build
83+
yarn build

‎.github/workflows/run-tests.yaml

+21-23
Original file line numberDiff line numberDiff line change
@@ -26,48 +26,46 @@ jobs:
2626
echo "YARN_ENABLE_IMMUTABLE_INSTALLS=false" >> $GITHUB_ENV
2727
npm install -g create-interchain-app
2828
29-
- name: ibc-asset-list
29+
- name: authz
3030
run: |
31-
cia --example ibc-asset-list --name ibc-asset-list
32-
cd ibc-asset-list
31+
cia --example authz --name authz
32+
cd authz
3333
yarn build
3434
35-
- name: vote-proposal
35+
- name: ibc-asset-list
3636
run: |
37-
cia --example vote-proposal --name vote-proposal
38-
cd vote-proposal
37+
cia --example ibc-asset-list --name ibc-asset-list
38+
cd ibc-asset-list
3939
yarn build
4040
41-
- name: ibc-transfer
41+
- name: injective
4242
run: |
43-
cia --example ibc-transfer --name ibc-transfer
44-
cd ibc-transfer
43+
cia --example injective --name injective
44+
cd injective
4545
yarn build
4646
47-
- name: swap-tokens
47+
- name: injective-vue
4848
run: |
49-
cia --example swap-tokens --name swap-tokens
50-
cd swap-tokens
49+
cia --example injective-vue --name injective-vue
50+
cd injective-vue
5151
yarn build
5252
53-
- name: provide-liquidity
53+
- name: stake-tokens
5454
run: |
55-
cia --example provide-liquidity --name provide-liquidity
56-
cd provide-liquidity
55+
cia --example stake-tokens --name stake-tokens
56+
cd stake-tokens
5757
yarn build
5858
59-
- name: nft
59+
- name: vote-proposal
6060
run: |
61-
cia --example nft --name nft
62-
cd nft
63-
touch yarn.lock
64-
yarn install
61+
cia --example vote-proposal --name vote-proposal
62+
cd vote-proposal
6563
yarn build
6664
67-
- name: authz
65+
- name: chain-template
6866
run: |
69-
cia --example authz --name authz
70-
cd authz
67+
cia --template chain-template --name chain-template
68+
cd chain-template
7169
yarn build
7270
7371
- name: connect-chain

0 commit comments

Comments
 (0)
Please sign in to comment.