Skip to content

Commit 68c4859

Browse files
committed
Add Ci/Cache
1 parent c52c330 commit 68c4859

File tree

4 files changed

+28
-41
lines changed

4 files changed

+28
-41
lines changed

.direnv/flake-profile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
flake-profile-4-link
1+
flake-profile-1-link

.direnv/flake-profile-1-link

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/nix/store/lya1pmb0dz3b7snvgbxmkxaav41yrzq4-nix-shell-env

.direnv/flake-profile-4-link

-1
This file was deleted.

.github/workflows/rust.yml

+26-39
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,33 @@
1-
name: Rust
2-
1+
# inspired by https://github.com/danth/stylix/blob/master/.github/workflows/docs.yml
2+
name: Rust-build
33
on:
44
push:
5+
branches: ["main"]
56
pull_request:
6-
branches: [ "main" ]
7-
8-
env:
9-
CARGO_TERM_COLOR: always
10-
7+
branches: ["main"]
118
jobs:
129
build:
13-
10+
name: Build
11+
permissions:
12+
contents: read
1413
runs-on: ubuntu-latest
15-
1614
steps:
17-
- uses: actions/checkout@v3
18-
- name: Install gtk
19-
run: sudo apt install libgtk-3-dev libgtk-layer-shell0 libgtk-layer-shell-dev -y
20-
- name: nightly-rust
21-
uses: actions-rs/toolchain@v1
22-
with:
23-
profile: minimal
24-
toolchain: nightly
25-
- name: Use nightly rust
26-
run: rustup default nightly
27-
- name: Cache
28-
uses: actions/cache@v3
29-
with:
30-
path: target/debug
31-
key: ${{ runner.os }}-cache
32-
- name: run code coverage
33-
uses: actions-rs/tarpaulin@v0.1
34-
with:
35-
version: '0.15.0'
36-
args: '-- --test-threads 1'
37-
- name: upload code coverage
38-
uses: actions/upload-artifact@v1
39-
with:
40-
name: code-coverage-report
41-
path: cobertura.xml
42-
43-
- name: Build
44-
run: cargo build --verbose
45-
- name: Run tests
46-
run: cargo test --verbose
15+
- name: Install Nix
16+
uses: DeterminateSystems/nix-installer-action@main
17+
with:
18+
github-token: ${{ secrets.GITHUB_TOKEN }}
19+
extra-conf: |
20+
extra-experimental-features = nix-command flakes
21+
- name: Set up cache
22+
uses: DeterminateSystems/magic-nix-cache-action@main
23+
- name: action
24+
uses: cachix/install-nix-action@v25
25+
with:
26+
nix_path: nixpkgs=channel:nixos-unstable
27+
- name: cache
28+
uses: cachix/cachix-action@v14
29+
with:
30+
name: oxinoti
31+
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
32+
- name: Build
33+
run: nix -L build github:${{ github.repository }}/${{ github.sha }} --no-write-lock-file

0 commit comments

Comments
 (0)