Skip to content

Commit

Permalink
Merge pull request #69 from neighbour-hoods/nixify-ci
Browse files Browse the repository at this point in the history
nixify ci
  • Loading branch information
mhuesch authored Jun 8, 2022
2 parents 1030723 + b810bc2 commit faf80bb
Show file tree
Hide file tree
Showing 6 changed files with 164 additions and 158 deletions.
91 changes: 46 additions & 45 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# lifted from https://shift.click/blog/github-actions-rust/#basic-rust-starter-template
# thanks 🙏
name: CI

name: "CI"
on:
pull_request:
push:
Expand All @@ -12,49 +9,53 @@ env:
RUST_BACKTRACE: 1

jobs:
test:
name: test with Rust ${{ matrix.rust }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { rust: stable, os: ubuntu-latest }
# - { rust: beta, os: ubuntu-latest }
# - { rust: nightly, os: ubuntu-latest }
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.rust }}
- run: cd rep_lang_concrete_syntax && CARGO_TARGET_DIR=../target cargo test --verbose
- run: cd rep_lang_core && CARGO_TARGET_DIR=../target cargo test --verbose
- run: cd rep_lang_runtime && CARGO_TARGET_DIR=../target cargo test --verbose
# - run: cargo test --verbose --workspace --all-features
# - run: cargo test --verbose --workspace --no-default-features

# clippy:
# name: Lint with clippy
# runs-on: ubuntu-latest
# env:
# RUSTFLAGS: -Dwarnings
# steps:
# - uses: actions/checkout@v2
# - uses: hecrj/setup-rust-action@v1
# with:
# components: clippy
# - run: cargo clippy --workspace --all-targets --verbose
# - run: cargo clippy --workspace --all-targets --verbose --no-default-features
# - run: cargo clippy --workspace --all-targets --verbose --all-features
cargo_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: cachix/install-nix-action@v15
with:
extra_nix_config: |
trusted-public-keys = cache.holo.host-1:lNXIXtJgS9Iuw4Cu6X0HINLu9sTfcjEntnrgwMQIMcE= cache.holo.host-2:ZJCkX3AUYZ8soxTLfTb60g+F3MkWD7hkH9y8CgqwhDQ= holochain-ci.cachix.org-1:5IUSkZc0aoRS53rfkvH9Kid40NpyjwCMCzwRTXy+QN8= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
substituters = https://cache.holo.host https://holochain-ci.cachix.org https://cache.nixos.org/
- name: ⚡ Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: cachix/cachix-action@v10
with:
name: neighbourhoods
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix-shell --command "cd rep_lang_concrete_syntax && CARGO_TARGET_DIR=../target cargo test --verbose"
- run: nix-shell --command "cd rep_lang_core && CARGO_TARGET_DIR=../target cargo test --verbose"
- run: nix-shell --command "cd rep_lang_runtime && CARGO_TARGET_DIR=../target cargo test --verbose"

rustfmt:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
components: rustfmt
- run: cd rep_lang_concrete_syntax && CARGO_TARGET_DIR=../target cargo fmt -- --check
- run: cd rep_lang_core && CARGO_TARGET_DIR=../target cargo fmt -- --check
- run: cd rep_lang_runtime && CARGO_TARGET_DIR=../target cargo fmt -- --check
- uses: actions/[email protected]
- uses: cachix/install-nix-action@v15
with:
extra_nix_config: |
trusted-public-keys = cache.holo.host-1:lNXIXtJgS9Iuw4Cu6X0HINLu9sTfcjEntnrgwMQIMcE= cache.holo.host-2:ZJCkX3AUYZ8soxTLfTb60g+F3MkWD7hkH9y8CgqwhDQ= holochain-ci.cachix.org-1:5IUSkZc0aoRS53rfkvH9Kid40NpyjwCMCzwRTXy+QN8= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
substituters = https://cache.holo.host https://holochain-ci.cachix.org https://cache.nixos.org/
- name: ⚡ Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: cachix/cachix-action@v10
with:
name: neighbourhoods
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix-shell --command "cd rep_lang_concrete_syntax && CARGO_TARGET_DIR=../target cargo fmt -- --check"
- run: nix-shell --command "cd rep_lang_core && CARGO_TARGET_DIR=../target cargo fmt -- --check"
- run: nix-shell --command "cd rep_lang_runtime && CARGO_TARGET_DIR=../target cargo fmt -- --check"
119 changes: 72 additions & 47 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit faf80bb

Please sign in to comment.