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

improve build time in CI #97

Merged
merged 3 commits into from
Jun 25, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
20 changes: 18 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: rustup component add clippy
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
- run: cargo install cargo-when
- name: Build
run: ./build.sh
- name: Run tests
Expand All @@ -27,10 +35,18 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- run: cargo install cargo-when
- name: Build
run: ./build.sh
- uses: actions/setup-go@v2
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ For other platforms, please use the devcontainer that we prepared.

## Building

```sh
$ cargo install cargo-when # installs prerequisite for building youki
```

```sh
$ git clone git@github.com:containers/youki.git
$ cd youki
Expand Down
5 changes: 2 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ VERSION=debug
if [[ "$1" == "--release" ]]; then
VERSION=release
fi
cargo when --channel=stable build --verbose $TGT $1 && \
cargo when --channel=beta build --verbose $TGT $1 && \
cargo when --channel=nightly build --verbose --features nightly $TGT $1 && \

cargo build --verbose $TGT $1
rm -f youki
cp target/$TARGET/$VERSION/youki .