Skip to content

Commit

Permalink
Use self-hosted runner
Browse files Browse the repository at this point in the history
  • Loading branch information
Wojtek committed Jun 17, 2024
1 parent 1bb5d48 commit a9fa000
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 77 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/contract-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,9 @@ env:
CARGO_TERM_COLOR: always
jobs:
ci:
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Set up cargo/wasm cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
contract/target/
key: ${{ runner.os }}-cargo-wasm-cache-${{ hashFiles('**/Cargo.lock') }}
- name: Lint contract
run: make lint-contract
- name: Build contract
Expand Down
56 changes: 1 addition & 55 deletions .github/workflows/relayer-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,77 +21,23 @@ jobs:
include:
- ci_step: "lint"
command: make lint
wasm-cache: false
linter-cache: true
docker-cache: false
- ci_step: "test"
command: make test fuzz-test
wasm-cache: false
linter-cache: false
docker-cache: false
- ci_step: "integration tests contract"
command: make integration-tests-contract
wasm-cache: true
linter-cache: false
docker-cache: true
- ci_step: "integration tests processes"
command: make integration-tests-processes
wasm-cache: true
linter-cache: false
docker-cache: true
- ci_step: "integration tests xrpl"
command: make integration-tests-xrpl
wasm-cache: true
linter-cache: false
docker-cache: true

runs-on: ubuntu-22.04
runs-on: self-hosted
steps:
- name: Go version used to build builder
run: go version
- name: Checkout coreumbridge-xrpl
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup go cache
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Setup WASM cache
uses: actions/cache@v3
if: ${{ matrix.wasm-cache }}
with:
# we need to exclude code-hashes.json from the rest, since the invalidation condition for it is not
# same as WASM cache, but it is same as smart contract artifacts.
path: |
~/.cache/crust/wasm
!/.cache/crust/wasm/code-hashes.json
key: ${{ runner.os }}-wasm-cache-${{ hashFiles('~/.cache/crust/wasm/**/*.rs') }}
- name: Setup linter cache
uses: actions/cache@v4
if: ${{ matrix.linter-cache }}
with:
path: ~/.cache/golangci-lint
key: ${{ runner.os }}-go-linter
- name: Set docker cache
uses: ScribeMD/docker-cache@0.5.0
with:
key: ${{ runner.os }}-docker-${{ hashFiles('build/go.sum') }}
- name: Setup smart contract build cache
uses: actions/cache@v3
with:
# we need to cache code-hashes.json under the same key as the artifacts, since the invalidation condition
# for both of them are the same.
path: |
${{ github.workspace }}/contract/artifacts/*
~/.cache/crust/wasm/code-hashes.json
key: ${{ runner.os }}-cache-smart-contracts-${{ hashFiles('./contract/**/*.rs') }}
if: ${{ matrix.wasm-cache }}
- name: Prepare dependencies
run: make dependencies
- name: Run ${{ matrix.ci_step }}
run: ${{ matrix.command }}
- name: Dump docker logs on failure
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
release:
runs-on: ubuntu-22.04
runs-on: self-hosted
steps:
- name: Checkout the repo
uses: actions/checkout@v4
Expand Down
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ release:
release-images:
$(BUILDER) release/images

.PHONY: dependencies
dependencies:
$(BUILDER) download

.PHONY: integration-tests-xrpl
integration-tests-xrpl:
$(BUILDER) integration-tests/xrpl
Expand Down
5 changes: 0 additions & 5 deletions build/bridge/relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ func Lint(ctx context.Context, deps types.DepsFunc) error {
return nil
}

// DownloadDependencies downloads go dependencies.
func DownloadDependencies(ctx context.Context, deps types.DepsFunc) error {
return golang.DownloadDependencies(ctx, deps, repoPath)
}

func relayerVersionLDFlags(ctx context.Context) ([]string, error) {
hash, err := git.DirtyHeadHash(ctx)
if err != nil {
Expand Down
1 change: 0 additions & 1 deletion build/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ var Commands = map[string]types.Command{
}, Description: "Builds relayer and smart contract"},
"build/relayer": {Fn: bridge.BuildRelayer, Description: "Builds relayer"},
"build/contract": {Fn: bridge.BuildSmartContract, Description: "Builds smart contract"},
"download": {Fn: bridge.DownloadDependencies, Description: "Downloads go dependencies"},
"fuzz-test": {Fn: bridge.RunFuzzTests, Description: "Runs fuzz tests"},
"generate": {Fn: bridge.Generate, Description: "Generates artifacts"},
"images": {Fn: bridge.BuildRelayerDockerImage, Description: "Builds relayer docker image"},
Expand Down

0 comments on commit a9fa000

Please sign in to comment.