Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move subdirectories under runtime to top level #3620

Merged
merged 5 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ jobs:

- name: Run benchmark on current branch
run: |
( for i in {1..${{ steps.settings.outputs.benchmark_repetitions }}}; do go test ./... -run=XXX -bench=. -benchmem -shuffle=on; done | sed 's/pkg:.*/pkg: github.com\/onflow\/cadence\/runtime/' ) | tee new.txt
( for i in {1..${{ steps.settings.outputs.benchmark_repetitions }}}; do go test ./... -run=XXX -bench=. -benchmem -shuffle=on; done | sed 's/pkg:.*/pkg: github.com\/onflow\/cadence\/' ) | tee new.txt
# the package replace line above is to make the results table more readable, since it is not fragmented by package

- name: Checkout base branch
run: git checkout ${{ github.event.pull_request.base.sha }}

- name: Run benchmark on base branch
run: |
( for i in {1..${{ steps.settings.outputs.benchmark_repetitions }}}; do go test ./... -run=XXX -bench=. -benchmem -shuffle=on; done | sed 's/pkg:.*/pkg: github.com\/onflow\/cadence\/runtime/' ) | tee old.txt
( for i in {1..${{ steps.settings.outputs.benchmark_repetitions }}}; do go test ./... -run=XXX -bench=. -benchmem -shuffle=on; done | sed 's/pkg:.*/pkg: github.com\/onflow\/cadence\/' ) | tee old.txt

# see https://trstringer.com/github-actions-multiline-strings/ to see why this part is complex
- name: Use benchstat for comparison
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
run: make ci

- name: Cadence Testing Framework
run: cd runtime/stdlib/contracts && flow test --cover --covercode="contracts" crypto_test.cdc
run: cd stdlib/contracts && flow test --cover --covercode="contracts" crypto_test.cdc

- name: Upload coverage report
uses: codecov/codecov-action@v2
Expand Down
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ suppressions

coverage.txt
coverage.txt-e
runtime/cmd/check/check
runtime/cmd/main/main
runtime/cmd/parse/parse
runtime/cmd/parse/parse.wasm
cmd/check/check
cmd/main/main
cmd/parse/parse
cmd/parse/parse.wasm
tools/golangci-lint/golangci-lint
tools/maprange/maprange
tools/unkeyed/unkeyed
Expand Down
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ GOPATH ?= $(HOME)/go
# Ensure go bin path is in path (Especially for CI)
PATH := $(PATH):$(GOPATH)/bin

COVERPKGS := $(shell go list ./... | grep -v /cmd | grep -v /runtime/test | tr "\n" "," | sed 's/,*$$//')
COVERPKGS := $(shell go list ./... | grep -v /cmd | grep -v /test | tr "\n" "," | sed 's/,*$$//')


LINTERS :=
Expand All @@ -30,19 +30,19 @@ ifneq ($(linters),)
endif

.PHONY: build
build: build-tools ./runtime/cmd/parse/parse ./runtime/cmd/parse/parse.wasm ./runtime/cmd/check/check ./runtime/cmd/main/main
build: build-tools ./cmd/parse/parse ./cmd/parse/parse.wasm ./cmd/check/check ./cmd/main/main

./runtime/cmd/parse/parse:
go build -o $@ ./runtime/cmd/parse
./cmd/parse/parse:
go build -o $@ ./cmd/parse

./runtime/cmd/parse/parse.wasm:
GOARCH=wasm GOOS=js go build -o $@ ./runtime/cmd/parse
./cmd/parse/parse.wasm:
GOARCH=wasm GOOS=js go build -o $@ ./cmd/parse

./runtime/cmd/check/check:
go build -o $@ ./runtime/cmd/check
./cmd/check/check:
go build -o $@ ./cmd/check

./runtime/cmd/main/main:
go build -o $@ ./runtime/cmd/main
./cmd/main/main:
go build -o $@ ./cmd/main

.PHONY: build-tools
build-tools: build-analysis build-get-contracts
Expand All @@ -60,7 +60,7 @@ ci:
# test all packages
go test -coverprofile=coverage.txt -covermode=atomic -parallel 8 -race -coverpkg $(COVERPKGS) ./...
# run interpreter smoke tests. results from run above are reused, so no tests runs are duplicated
go test -count=5 ./runtime/tests/interpreter/... -runSmokeTests=true -validateAtree=false
go test -count=5 ./tests/interpreter/... -runSmokeTests=true -validateAtree=false
# remove coverage of empty functions from report
sed -i -e 's/^.* 0 0$$//' coverage.txt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package activations

import (
"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
)

// Activation is a map of strings to values.
Expand Down
4 changes: 2 additions & 2 deletions runtime/ast/access.go → ast/access.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"encoding/json"
"strings"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/runtime/errors"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/errors"
)

//go:generate go run golang.org/x/tools/cmd/stringer -type=PrimitiveAccess
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion runtime/ast/argument.go → ast/argument.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/turbolent/prettier"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
)

type Argument struct {
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion runtime/ast/attachment.go → ast/attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/turbolent/prettier"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
)

// AttachmentDeclaration
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion runtime/ast/block.go → ast/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/turbolent/prettier"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
)

type Block struct {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions runtime/ast/composite.go → ast/composite.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (

"github.com/turbolent/prettier"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/runtime/errors"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/errors"
)

// ConformingDeclaration
Expand Down
2 changes: 1 addition & 1 deletion runtime/ast/composite_test.go → ast/composite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/turbolent/prettier"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
)

func TestFieldDeclaration_MarshalJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion runtime/ast/conditionkind.go → ast/conditionkind.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package ast
import (
"encoding/json"

"github.com/onflow/cadence/runtime/errors"
"github.com/onflow/cadence/errors"
)

//go:generate go run golang.org/x/tools/cmd/stringer -type=ConditionKind
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion runtime/ast/declaration.go → ast/declaration.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/turbolent/prettier"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
)

type Declaration interface {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/turbolent/prettier"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
)

// EntitlementDeclaration
Expand Down
4 changes: 2 additions & 2 deletions runtime/ast/expression.go → ast/expression.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import (

"github.com/turbolent/prettier"

"github.com/onflow/cadence/runtime/errors"
"github.com/onflow/cadence/errors"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
)

const NilConstant = "nil"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ package ast
import (
"fmt"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/runtime/errors"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/errors"
)

type VoidExtractor interface {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (

"github.com/turbolent/prettier"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/runtime/errors"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/errors"
)

type FunctionPurity int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/turbolent/prettier"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
)

func TestFunctionDeclaration_MarshalJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion runtime/ast/identifier.go → ast/identifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package ast
import (
"encoding/json"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
)

// Identifier
Expand Down
2 changes: 1 addition & 1 deletion runtime/ast/import.go → ast/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/turbolent/prettier"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
)

// ImportDeclaration
Expand Down
2 changes: 1 addition & 1 deletion runtime/ast/import_test.go → ast/import_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/turbolent/prettier"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
)

func TestImportDeclaration_MarshalJSON(t *testing.T) {
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions runtime/ast/inspector_test.go → ast/inspector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import (

"github.com/stretchr/testify/require"

"github.com/onflow/cadence/runtime/ast"
"github.com/onflow/cadence/runtime/parser"
"github.com/onflow/cadence/runtime/tests/examples"
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/parser"
"github.com/onflow/cadence/tests/examples"
)

// TestInspector_Elements compares Inspector against Inspect.
Expand Down
2 changes: 1 addition & 1 deletion runtime/ast/interface.go → ast/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/turbolent/prettier"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
)

// InterfaceDeclaration
Expand Down
2 changes: 1 addition & 1 deletion runtime/ast/interface_test.go → ast/interface_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/turbolent/prettier"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
)

func TestInterfaceDeclaration_MarshalJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion runtime/ast/memberindices.go → ast/memberindices.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package ast
import (
"sync"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
)

// programIndices is a container for all indices of members
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

"github.com/stretchr/testify/require"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
)

func TestMemberIndices(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion runtime/ast/members.go → ast/members.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/turbolent/prettier"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
)

// Members
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion runtime/ast/operation.go → ast/operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package ast
import (
"encoding/json"

"github.com/onflow/cadence/runtime/errors"
"github.com/onflow/cadence/errors"
)

//go:generate go run golang.org/x/tools/cmd/stringer -type=Operation
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion runtime/ast/parameter.go → ast/parameter.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/turbolent/prettier"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
)

type Parameter struct {
Expand Down
2 changes: 1 addition & 1 deletion runtime/ast/parameterlist.go → ast/parameterlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/turbolent/prettier"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
)

type ParameterList struct {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion runtime/ast/position.go → ast/position.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package ast
import (
"fmt"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
)

var EmptyPosition = Position{}
Expand Down
2 changes: 1 addition & 1 deletion runtime/ast/pragma.go → ast/pragma.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/turbolent/prettier"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
)

// Pragma
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion runtime/ast/program.go → ast/program.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/turbolent/prettier"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
)

type Program struct {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

"github.com/stretchr/testify/require"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
)

func TestProgramIndices(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion runtime/ast/statement.go → ast/statement.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

"github.com/turbolent/prettier"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
)

type Statement interface {
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions runtime/ast/string_test.go → ast/string_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (

"github.com/stretchr/testify/assert"

"github.com/onflow/cadence/runtime/ast"
"github.com/onflow/cadence/runtime/parser"
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/parser"
)

func TestQuoteString(t *testing.T) {
Expand Down
Loading
Loading