Skip to content

Commit

Permalink
Crystalin ci hosted (paritytech#181)
Browse files Browse the repository at this point in the history
* Move CI to self-hosted

* Moves editorconfig check binary to tmp (WIP)

* Removes (slow) cache

* testing better ec-linux check

* prevent editorconfig on binary files

* testing sccache

* testing sccache
  • Loading branch information
crystalin authored Jan 18, 2021
1 parent 12986bb commit 791e93b
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 30 deletions.
6 changes: 0 additions & 6 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
root = true

[*]
end_of_line=lf
charset=utf-8
trim_trailing_whitespace=true
insert_final_newline=true

[*.rs]
indent_style=tab
indent_size=tab
Expand Down
69 changes: 45 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
####### Check files and formatting #######

check-copyright:
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Checkout
if: github.event_name == 'pull_request_target'
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
fi
check-links:
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Checkout
if: github.event_name == 'pull_request_target'
Expand All @@ -63,7 +63,7 @@ jobs:

check-editorconfig:
name: "Check editorconfig"
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Checkout
if: github.event_name == 'pull_request_target'
Expand All @@ -76,15 +76,17 @@ jobs:
uses: actions/checkout@v2
- name: Setup editorconfig checker
run: |
wget https://github.com/editorconfig-checker/editorconfig-checker/releases/download/2.1.0/ec-linux-amd64.tar.gz
tar xvf ec-linux-amd64.tar.gz
ls /tmp/bin/ec-linux-amd64 || \
cd /tmp && \
wget https://github.com/editorconfig-checker/editorconfig-checker/releases/download/2.1.0/ec-linux-amd64.tar.gz && \
tar xvf ec-linux-amd64.tar.gz && \
chmod +x bin/ec-linux-amd64
- name: Check files
run: bin/ec-linux-amd64
run: /tmp/bin/ec-linux-amd64

check-prettier:
name: "Check with Prettier"
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Checkout
if: github.event_name == 'pull_request_target'
Expand All @@ -100,7 +102,7 @@ jobs:

check-clippy:
name: "Code checks"
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Checkout
if: github.event_name == 'pull_request_target'
Expand Down Expand Up @@ -131,7 +133,9 @@ jobs:
####### Building and Testing binaries #######

build:
runs-on: ubuntu-latest
runs-on: self-hosted
env:
CARGO_SCCACHE_VERSION: 0.2.14-alpha.0-parity
outputs:
RUSTC: ${{ steps.get-rust-versions.outputs.rustc }}
steps:
Expand All @@ -144,18 +148,35 @@ jobs:
- name: Checkout
if: github.event_name != 'pull_request_target'
uses: actions/checkout@v2
- name: Cache Rust dependencies
uses: actions/cache@v2
id: cache
# Install sccache
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
node/standalone/target
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.OS }}-build
path: ${{ runner.tool_cache }}/cargo-sccache
key: ${{ runner.OS }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1
- name: Install sccache
run: |
if [ ! -f ${{ runner.tool_cache }}/cargo-sccache/bin/sccache ]; then
cargo install sccache --git https://github.com/paritytech/sccache.git --no-default-features --features=dist-client --root ${{ runner.tool_cache }}/cargo-sccache
fi
shell: bash
- name: Start sccache
run: |
chmod +x ${{ runner.tool_cache }}/cargo-sccache/bin/sccache
${{ runner.tool_cache }}/cargo-sccache/bin/sccache --start-server
${{ runner.tool_cache }}/cargo-sccache/bin/sccache -s
echo "RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache" >> $GITHUB_ENV
# - name: Cache Rust dependencies
# uses: actions/cache@v2
# id: cache
# with:
# path: |
# ~/.cargo/registry
# ~/.cargo/git
# target
# node/standalone/target
# key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
# restore-keys: |
# ${{ runner.OS }}-build
- uses: actions-rs/toolchain@v1
with:
target: wasm32-unknown-unknown
Expand Down Expand Up @@ -215,7 +236,7 @@ jobs:
####### Prepare and Deploy Docker images #######

docker-parachain:
runs-on: ubuntu-latest
runs-on: self-hosted
needs: ["build"]
if: github.event_name == 'push'
steps:
Expand Down Expand Up @@ -286,7 +307,7 @@ jobs:
org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }}
docker-standalone:
runs-on: ubuntu-latest
runs-on: self-hosted
needs: ["build"]
if: github.event_name == 'push'
steps:
Expand Down Expand Up @@ -359,7 +380,7 @@ jobs:
####### Prepare the release draft #######

publish-draft-release:
runs-on: ubuntu-latest
runs-on: self-hosted
needs: ["build"]
if: |
github.event_name == 'push' &&
Expand Down Expand Up @@ -396,7 +417,7 @@ jobs:
draft: true

publish-runtimes:
runs-on: ubuntu-latest
runs-on: self-hosted
needs: ["publish-draft-release"]
# We want to store the binaries also when it is not a version release. This is used
# in case such as providing binaries when creating a new tutorial version.
Expand Down

0 comments on commit 791e93b

Please sign in to comment.