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

ci: don't have separate parallel lint steps #367

Merged
merged 1 commit into from
Mar 15, 2022
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 6 additions & 21 deletions .github/workflows/arbitrator-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,6 @@ env:
WABT_VERSION: 1.0.24

jobs:
rustfmt:
name: Rust formatting check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install rust stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt

- name: Rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all --manifest-path arbitrator/Cargo.toml -- --check

coverage:
name: Run Arbitrator tests
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -161,6 +140,12 @@ jobs:
command: test
args: --all --manifest-path arbitrator/Cargo.toml

- name: Rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all --manifest-path arbitrator/Cargo.toml -- --check

- name: Make proofs from test cases
run: make -j test-gen-proofs

Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/arbitrator-skip-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ on:
- 'Makefile'

jobs:
rustfmt:
name: Rust formatting check
runs-on: ubuntu-latest
steps:
- name: Do nothing
run: echo "doing nothing"
coverage:
name: Run Arbitrator tests
runs-on: ubuntu-latest
Expand Down
96 changes: 10 additions & 86 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,92 +9,6 @@ on:
- develop

jobs:
lint:
name: Linter
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.PRIVATE_CHECKOUT }}
submodules: recursive

- name: Setup nodejs
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'

- name: Install go
uses: actions/setup-go@v2
with:
go-version: 1.17.x

- name: Install protobufs
run: |
sudo apt update && sudo apt install -y protobuf-compiler
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]

- name: Install rust stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Cache Build Products
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-lint-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-

- name: Cache cbrotli
uses: actions/cache@v2
id: cache-cbrotli
with:
path: |
target/include/brotli/
target/lib-wasm/
target/lib/libbrotlicommon-static.a
target/lib/libbrotlienc-static.a
target/lib/libbrotlidec-static.a
key: ${{ runner.os }}-brotli-${{ hashFiles('build-brotli.sh') }}-${{ hashFiles('.github/workflows/arbitrator-ci.yaml') }}
restore-keys: ${{ runner.os }}-brotli-

- name: Build cbrotli-local
if: steps.cache-cbrotli.outputs.cache-hit != 'true'
run: ./build-brotli.sh -l

- name: Setup emsdk
if: steps.cache-cbrotli.outputs.cache-hit != 'true'
uses: mymindstorm/setup-emsdk@v11
with:
# Make sure to set a version number!
version: 3.1.6
# This is the name of the cache folder.
# The cache folder will be placed in the build directory,
# so make sure it doesn't conflict with anything!
actions-cache-folder: 'emsdk-cache'

- name: Build cbrotli-wasm
if: steps.cache-cbrotli.outputs.cache-hit != 'true'
run: ./build-brotli.sh -w

- name: Build all lint dependencies
run: make -j build-node-deps

- name: Lint
uses: golangci/golangci-lint-action@v2
with:
version: latest
skip-go-installation: true
skip-pkg-cache: true

test:
name: Go Tests
runs-on: ubuntu-latest
Expand Down Expand Up @@ -218,6 +132,16 @@ jobs:
- name: Build
run: make build test-go-deps -j

- name: Build all lint dependencies
run: make -j build-node-deps

- name: Lint
uses: golangci/golangci-lint-action@v2
with:
version: latest
skip-go-installation: true
skip-pkg-cache: true

- name: run tests with race detection
run: gotestsum --format short-verbose --jsonfile test-output-withrace.json -- -race ./...

Expand Down