Adjust cases for gas price limit increase #19
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: ci_axon | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
contract-tests: | |
strategy: | |
matrix: | |
os: [ ubuntu-22.04 ] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout Axon Tests | |
uses: actions/checkout@v4 | |
- name: Checkout Axon | |
uses: actions/checkout@v4 | |
with: | |
repository: axonweb3/axon | |
# axonweb3/axon#1526 | |
ref: bc7336aad8d23a1d2b6ff4399d01848ba828e758 | |
path: axon | |
- name: Cache of Cargo | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
axon/target/ | |
key: ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build-${{ hashFiles('axon/**/Cargo.lock') }} | |
restore-keys: | | |
${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build | |
- name: Build Axon | |
working-directory: axon | |
run: cargo build | |
- name: Deploy Local Network of Axon | |
working-directory: axon | |
run: | | |
rm -rf ./devtools/chain/data | |
./target/debug/axon init \ | |
--config devtools/chain/config.toml \ | |
--chain-spec devtools/chain/specs/single_node/chain-spec.toml \ | |
> axon.log 2>&1 | |
./target/debug/axon run \ | |
--config devtools/chain/config.toml \ | |
>> axon.log 2>&1 & | |
- name: Check Axon Status Before Test | |
run: | | |
MAX_RETRIES=10 | |
for i in $(seq 1 $MAX_RETRIES); do | |
sleep 10 | |
response=$(curl -s -w "\n%{http_code}" http://localhost:8000 -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"web3_clientVersion","params": [],"id":1}') | |
http_code=$(echo "$response" | tail -n1) | |
response_body=$(echo "$response" | sed '$d') | |
if [[ "$http_code" -eq 200 ]]; then | |
echo "$response_body" | |
exit 0 | |
else | |
echo "Axon status check failed with HTTP status code: $http_code, retrying ($i/$MAX_RETRIES)" | |
if [[ "$i" -eq $MAX_RETRIES ]]; then | |
echo "Axon status check failed after $MAX_RETRIES attempts." | |
exit 1 | |
fi | |
fi | |
done | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "18" | |
- name: Get yarn cache directory | |
id: yarn-cache-dir | |
run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT} | |
- name: Get npm cache directory | |
id: npm-cache-dir | |
shell: bash | |
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | |
- name: Node Cache | |
uses: actions/cache@v3 | |
id: npm-and-yarn-cache | |
with: | |
path: | | |
${{ steps.yarn-cache-dir.outputs.dir }} | |
${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-node_modules- | |
- name: Run Axon Tests | |
run: | | |
npm install | |
npm run test:test --network=axon_test --grep="" | |
- name: Check Axon Status | |
if: success() || failure() | |
run: | | |
curl http://localhost:8000 -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"web3_clientVersion","params": [],"id":1}' | |
- name: Copy the Log File into Report Directory | |
if: failure() | |
run: | | |
cp axon/chain.log mochawesome-report | |
- name: Publish reports | |
if: success() || failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: jfoa-build-reports-${{ runner.os }} | |
path: mochawesome-report/ |