Skip to content

Commit

Permalink
Remove swarm packages and related, fix unit tests (#9)
Browse files Browse the repository at this point in the history
* Remove swarm packages and related, fix unit tests

* chore: add GHA for go-ethereum

- for now on-pull-request and test

* chore: add GHA for go-ethereum

- added thor-upstream branch

* chore: add GHA for go-ethereum

- check version of go

* test: replace make test with go test in github workflow

* chore: add env to make test step

* chore: add GHA for go-ethereum

- remove master following Tony's comment

* revert env var in make test step

* remove fuzz temproraily

Signed-off-by: tony <[email protected]>

* skip mobile package in test

Signed-off-by: tony <[email protected]>

* remove incompatiable parseNode

Signed-off-by: tony <[email protected]>

---------

Signed-off-by: tony <[email protected]>
Co-authored-by: leszek-vechain <[email protected]>
Co-authored-by: tony <[email protected]>
  • Loading branch information
3 people authored Jul 15, 2024
1 parent 2994c2a commit 2743143
Show file tree
Hide file tree
Showing 280 changed files with 76 additions and 65,575 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/on-pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Pull Request CI

on:
pull_request:
branches:
- thor-upstream

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
run-unit-tests:
name: Run Unit Tests
uses: ./.github/workflows/test.yaml
30 changes: 30 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Unit Tests

on:
workflow_call:

jobs:
unit_tests:
strategy:
matrix:
go-version: [ 1.10.x ]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Go version
run: go version

- name: Make all
run: make all

- name: Make Test
id: unit-test
run: make test
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# with Go source code. If you know what GOPATH is then you probably
# don't need to bother with make.

.PHONY: geth android ios geth-cross swarm evm all test clean
.PHONY: geth android ios geth-cross evm all test clean
.PHONY: geth-linux geth-linux-386 geth-linux-amd64 geth-linux-mips64 geth-linux-mips64le
.PHONY: geth-linux-arm geth-linux-arm-5 geth-linux-arm-6 geth-linux-arm-7 geth-linux-arm64
.PHONY: geth-darwin geth-darwin-386 geth-darwin-amd64
Expand All @@ -16,11 +16,6 @@ geth:
@echo "Done building."
@echo "Run \"$(GOBIN)/geth\" to launch geth."

swarm:
build/env.sh go run build/ci.go install ./cmd/swarm
@echo "Done building."
@echo "Run \"$(GOBIN)/swarm\" to launch swarm."

all:
build/env.sh go run build/ci.go install

Expand Down
64 changes: 16 additions & 48 deletions build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

//go:build none
// +build none

/*
Expand All @@ -23,20 +24,19 @@ Usage: go run build/ci.go <command> <command flags/arguments>
Available commands are:
install [ -arch architecture ] [ -cc compiler ] [ packages... ] -- builds packages and executables
test [ -coverage ] [ packages... ] -- runs the tests
lint -- runs certain pre-selected linters
archive [ -arch architecture ] [ -type zip|tar ] [ -signer key-envvar ] [ -upload dest ] -- archives build artifacts
importkeys -- imports signing keys from env
debsrc [ -signer key-id ] [ -upload dest ] -- creates a debian source package
nsis -- creates a Windows NSIS installer
aar [ -local ] [ -sign key-id ] [-deploy repo] [ -upload dest ] -- creates an Android archive
xcode [ -local ] [ -sign key-id ] [-deploy repo] [ -upload dest ] -- creates an iOS XCode framework
xgo [ -alltools ] [ options ] -- cross builds according to options
purge [ -store blobstore ] [ -days threshold ] -- purges old archives from the blobstore
install [ -arch architecture ] [ -cc compiler ] [ packages... ] -- builds packages and executables
test [ -coverage ] [ packages... ] -- runs the tests
lint -- runs certain pre-selected linters
archive [ -arch architecture ] [ -type zip|tar ] [ -signer key-envvar ] [ -upload dest ] -- archives build artifacts
importkeys -- imports signing keys from env
debsrc [ -signer key-id ] [ -upload dest ] -- creates a debian source package
nsis -- creates a Windows NSIS installer
aar [ -local ] [ -sign key-id ] [-deploy repo] [ -upload dest ] -- creates an Android archive
xcode [ -local ] [ -sign key-id ] [-deploy repo] [ -upload dest ] -- creates an iOS XCode framework
xgo [ -alltools ] [ options ] -- cross builds according to options
purge [ -store blobstore ] [ -days threshold ] -- purges old archives from the blobstore
For all commands, -n prevents execution of external programs (dry run mode).
*/
package main

Expand All @@ -60,7 +60,6 @@ import (

"github.com/ethereum/go-ethereum/internal/build"
"github.com/ethereum/go-ethereum/params"
sv "github.com/ethereum/go-ethereum/swarm/version"
)

var (
Expand All @@ -82,12 +81,6 @@ var (
executablePath("wnode"),
}

// Files that end up in the swarm*.zip archive.
swarmArchiveFiles = []string{
"COPYING",
executablePath("swarm"),
}

// A debian package is created for all executables listed here.
debExecutables = []debExecutable{
{
Expand Down Expand Up @@ -120,36 +113,17 @@ var (
},
}

// A debian package is created for all executables listed here.
debSwarmExecutables = []debExecutable{
{
BinaryName: "swarm",
PackageName: "ethereum-swarm",
Description: "Ethereum Swarm daemon and tools",
},
}

debEthereum = debPackage{
Name: "ethereum",
Version: params.Version,
Executables: debExecutables,
}

debSwarm = debPackage{
Name: "ethereum-swarm",
Version: sv.Version,
Executables: debSwarmExecutables,
}

// Debian meta packages to build and push to Ubuntu PPA
debPackages = []debPackage{
debSwarm,
debEthereum,
}

// Packages to be cross-compiled by the xgo command
allCrossCompiledArchiveFiles = append(allToolsArchiveFiles, swarmArchiveFiles...)

// Distros for which packages are created.
// Note: vivid is unsupported because there is no golang-1.6 package for it.
// Note: wily is unsupported because it was officially deprecated on lanchpad.
Expand Down Expand Up @@ -408,9 +382,6 @@ func doArchive(cmdline []string) {
basegeth = archiveBasename(*arch, params.ArchiveVersion(env.Commit))
geth = "geth-" + basegeth + ext
alltools = "geth-alltools-" + basegeth + ext

baseswarm = archiveBasename(*arch, sv.ArchiveVersion(env.Commit))
swarm = "swarm-" + baseswarm + ext
)
maybeSkipArchive(env)
if err := build.WriteArchive(geth, gethArchiveFiles); err != nil {
Expand All @@ -419,10 +390,7 @@ func doArchive(cmdline []string) {
if err := build.WriteArchive(alltools, allToolsArchiveFiles); err != nil {
log.Fatal(err)
}
if err := build.WriteArchive(swarm, swarmArchiveFiles); err != nil {
log.Fatal(err)
}
for _, archive := range []string{geth, alltools, swarm} {
for _, archive := range []string{geth, alltools} {
if err := archiveUpload(archive, *upload, *signer); err != nil {
log.Fatal(err)
}
Expand Down Expand Up @@ -555,8 +523,8 @@ func isUnstableBuild(env build.Environment) bool {
}

type debPackage struct {
Name string // the name of the Debian package to produce, e.g. "ethereum", or "ethereum-swarm"
Version string // the clean version of the debPackage, e.g. 1.8.12 or 0.3.0, without any metadata
Name string // the name of the Debian package to produce, e.g. "ethereum"
Version string // the clean version of the debPackage, e.g. 1.8.12 without any metadata
Executables []debExecutable // executables to be included in the package
}

Expand Down Expand Up @@ -1001,7 +969,7 @@ func doXgo(cmdline []string) {

if *alltools {
args = append(args, []string{"--dest", GOBIN}...)
for _, res := range allCrossCompiledArchiveFiles {
for _, res := range allToolsArchiveFiles {
if strings.HasPrefix(res, GOBIN) {
// Binary tool found, cross build it explicitly
args = append(args, "./"+filepath.Join("cmd", filepath.Base(res)))
Expand Down
5 changes: 0 additions & 5 deletions build/deb/ethereum-swarm/deb.changelog

This file was deleted.

19 changes: 0 additions & 19 deletions build/deb/ethereum-swarm/deb.control

This file was deleted.

14 changes: 0 additions & 14 deletions build/deb/ethereum-swarm/deb.copyright

This file was deleted.

1 change: 0 additions & 1 deletion build/deb/ethereum-swarm/deb.docs

This file was deleted.

1 change: 0 additions & 1 deletion build/deb/ethereum-swarm/deb.install

This file was deleted.

13 changes: 0 additions & 13 deletions build/deb/ethereum-swarm/deb.rules

This file was deleted.

4 changes: 2 additions & 2 deletions build/deb/ethereum/deb.control
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Vcs-Browser: https://github.com/ethereum/go-ethereum
Package: {{.Name}}
Architecture: any
Depends: ${misc:Depends}, {{.ExeList}}
Description: Meta-package to install geth, swarm, and other tools
Meta-package to install geth, swarm and other tools
Description: Meta-package to install geth, and other tools
Meta-package to install geth and other tools

{{range .Executables}}
Package: {{$.ExeName .}}
Expand Down
3 changes: 1 addition & 2 deletions build/update-license.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build none
// +build none

/*
Expand Down Expand Up @@ -56,8 +57,6 @@ var (
"internal/jsre/deps",
"log/",
"common/bitutil/bitutil",
// don't license generated files
"contracts/chequebook/contract/code.go",
}

// paths with this prefix are licensed as GPL. all other files are LGPL.
Expand Down
Loading

0 comments on commit 2743143

Please sign in to comment.