Skip to content

Commit

Permalink
Merge pull request #693 from iotexproject/ci-cd-change
Browse files Browse the repository at this point in the history
update github ci
  • Loading branch information
huangzhiran authored Oct 11, 2024
2 parents 999a7a4 + abc46ce commit 09b88ee
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 26 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/test.yml → .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: run tests
name: Go unit tests

on:
push:
Expand All @@ -22,22 +22,14 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '21.x'

- name: Run tests for smart-contract
run: make contract-test


- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.22

- name: Run unit tests.
run: make test
run: make unit_test

- name: Upload Coverage report to CodeCov
uses: codecov/[email protected]
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/image.yaml → .github/workflows/image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ jobs:
include:
- name: apinode
image_name: iotexproject/w3bstream-apinode
dockerfile: apinode.Dockerfile
dockerfile: build/apinode.Dockerfile
- name: bootnode
image_name: iotexproject/w3bstream-bootnode
dockerfile: bootnode.Dockerfile
dockerfile: build/bootnode.Dockerfile
- name: prover
image_name: iotexproject/w3bstream-prover
dockerfile: prover.Dockerfile
dockerfile: build/prover.Dockerfile
- name: sequencer
image_name: iotexproject/w3bstream-sequencer
dockerfile: sequencer.Dockerfile
dockerfile: build/sequencer.Dockerfile

permissions:
contents: read
Expand Down
File renamed without changes.
32 changes: 32 additions & 0 deletions .github/workflows/solidity-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Solidity unit tests

on:
push:
branches: [ "develop"]
pull_request:
branches: [ "develop"]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
permissions:
contents: read
packages: write
id-token: write

steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '21.x'

- name: Run unit tests
run: make contract-test
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ docker-compose.local.yaml
docker-compose.local.yml
docker-compose.debug.yaml
docker-compose.debug.yml
build

# rust
examples/**/target/
Expand Down
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ build-sequencer:
# Docker targets
.PHONY: images
images:
docker build -f apinode.Dockerfile -t $(DOCKER_APINODE_TARGET) .
docker build -f prover.Dockerfile -t $(DOCKER_PROVER_TARGET) .
docker build -f bootnode.Dockerfile -t $(DOCKER_BOOTNODE_TARGET) .
docker build -f sequencer.Dockerfile -t $(DOCKER_SEQUENCER_TARGET) .

.PHONY: test
test:
go test -gcflags="all=-N -l" ./...
docker build -f build/apinode.Dockerfile -t $(DOCKER_APINODE_TARGET) .
docker build -f build/prover.Dockerfile -t $(DOCKER_PROVER_TARGET) .
docker build -f build/bootnode.Dockerfile -t $(DOCKER_BOOTNODE_TARGET) .
docker build -f build/sequencer.Dockerfile -t $(DOCKER_SEQUENCER_TARGET) .

.PHONY: unit_test
unit_test:
GOARCH=amd64 go test -gcflags="all=-N -l" ./... -covermode=atomic -coverprofile cover.out

# Clean targets
.PHONY: clean
Expand Down
1 change: 0 additions & 1 deletion apinode.Dockerfile → build/apinode.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# ghcr.io/machinefi/apinode:latest
FROM golang:1.22-alpine AS builder

ENV GO111MODULE=on
Expand Down
1 change: 0 additions & 1 deletion bootnode.Dockerfile → build/bootnode.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# ghcr.io/machinefi/bootnode:latest
FROM golang:1.22-alpine AS builder

ENV GO111MODULE=on
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 09b88ee

Please sign in to comment.