Skip to content

Commit

Permalink
ci: self hosted runners for ci and coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
toshke committed May 17, 2022
1 parent 92e232e commit fa9be9a
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 42 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
on:
workflow_dispatch:
push:
branches:
- development
Expand All @@ -19,11 +20,12 @@ env:
CARGO_HTTP_MULTIPLEXING: false
CARGO_TERM_COLOR: always
PROTOC: protoc

TERM: unkown

jobs:
clippy:
name: clippy
runs-on: ubuntu-18.04
runs-on: [ self-hosted, ubuntu18.04-high-cpu ]
steps:
- name: checkout
uses: actions/checkout@v2
Expand All @@ -33,7 +35,6 @@ jobs:
toolchain: ${{ env.toolchain }}
components: clippy, rustfmt
override: true
- uses: Swatinem/rust-cache@v1
- name: ubuntu dependencies
run: |
sudo apt-get update && \
Expand Down Expand Up @@ -66,7 +67,7 @@ jobs:
args: clippy --all-targets
build:
name: check nightly
runs-on: ubuntu-18.04
runs-on: [ self-hosted, ubuntu18.04-high-cpu ]
steps:
- name: checkout
uses: actions/checkout@v2
Expand All @@ -76,7 +77,6 @@ jobs:
toolchain: ${{ env.toolchain }}
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
- name: ubuntu dependencies
run: |
sudo apt-get update && \
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:

build-stable:
name: check stable
runs-on: ubuntu-18.04
runs-on: [ self-hosted, ubuntu18.04-high-cpu ]
steps:
- name: checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -146,10 +146,13 @@ jobs:
args: --release --package tari_wallet_ffi
javascript:
name: npm packages
runs-on: ubuntu-18.04
runs-on: [ ubuntu-20.04 ]
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: build launchpad gui-vue
run: |
cd applications/launchpad/gui-vue
Expand All @@ -168,7 +171,7 @@ jobs:
npm run check-fmt
licenses:
name: file licenses
runs-on: ubuntu-20.04
runs-on: [ ubuntu-20.04 ]
steps:
- name: checkout
uses: actions/checkout@v2
Expand All @@ -181,15 +184,14 @@ jobs:
run: ./scripts/file_license_check.sh
test:
name: test
runs-on: ubuntu-18.04
runs-on: [ self-hosted, ubuntu18.04-high-cpu ]
steps:
- name: checkout
uses: actions/checkout@v2
- name: toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.toolchain }}
- uses: Swatinem/rust-cache@v1
- name: ubuntu dependencies
run: |
sudo apt-get update && \
Expand Down Expand Up @@ -224,7 +226,7 @@ jobs:
# Allows other workflows to know the PR number
artifacts:
name: test
runs-on: ubuntu-18.04
runs-on: [ ubuntu-20.04 ]
steps:
- name: Save the PR number in an artifact
shell: bash
Expand Down
66 changes: 36 additions & 30 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
name: Source Coverage
on:
workflow_dispatch:
push:
branches:
- development

env:
toolchain: nightly-2021-11-20
- ci-*

jobs:
coverage:
name: test
runs-on: ubuntu-18.04
name: test and generate cov
runs-on: [ self-hosted, ubuntu18.04-high-mem ]
steps:
- name: checkout
uses: actions/checkout@v2
- name: toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.toolchain }}
override: true
components: llvm-tools-preview
- name: ubuntu dependencies
run: |
sudo apt-get update && \
Expand All @@ -46,28 +37,43 @@ jobs:
wget \
libappindicator3-dev \
patchelf \
librsvg2-dev \
- name: install grcov
run: |
cargo install grcov
- name: cargo test compile
uses: actions-rs/cargo@v1
librsvg2-dev
- name: checkout
uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: llvm-tools-preview
- uses: actions-rs/cargo@v1
with:
command: test
args: --no-run --locked --all-features
- name: cargo test
uses: actions-rs/cargo@v1
args: --all-features --no-fail-fast
env:
RUSTFLAGS: "-C instrument-coverage"
RUSTDOCFLAGS: "-C instrument-coverage"
LLVM_PROFILE_FILE: "coverage_data-%p-%m.profraw"
RUSTFLAGS: "-Zinstrument-coverage"
with:
command: test
args: --all-features
- name: generate coverage report
- id: coverage
name: Prepare coverage data
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
grcov . -s . --binary-path ./target/debug -t lcov --branch --ignore-not-existing -o ./target/report.lcov
cargo install grcov
grcov . -s . --binary-path ./target/debug -t coveralls --branch --ignore-not-existing \
-o ./target/coveralls_coverage.json \
--token $COVERALLS_REPO_TOKEN \
--vcs-branch $GITHUB_REF_NAME \
--service-name github \
--service-job-id ${GITHUB_RUN_ID}
- id: archive-coverage
name: archive-coverage
uses: actions/upload-artifact@v3
with:
path: target/coveralls_coverage.json
name: coveralls-coverage
- name: Coveralls upload
uses: coverallsapp/github-action@master
uses: toshke/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./target/report.lcov
path-to-lcov: ./target/coveralls_coverage.json
file-format: coveralls

0 comments on commit fa9be9a

Please sign in to comment.