-
Notifications
You must be signed in to change notification settings - Fork 98
97 lines (86 loc) · 3 KB
/
private-tangle-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Build and run specific tests on a private tangle
on:
push:
branches: [develop, production]
paths:
- ".github/workflows/private-tangle-tests.yml"
- ".github/actions/**"
- "**.rs"
- "**/tests/**"
- "**/test/**"
- "**Cargo.toml"
- "**Cargo.lock"
pull_request:
branches: [develop, production]
paths:
- ".github/workflows/private-tangle-tests.yml"
- ".github/actions/**"
- "**.rs"
- "**/tests/**"
- "**/test/**"
- "**Cargo.toml"
- "**Cargo.lock"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
crate:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Get current date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Install required packages
run: |
sudo apt-get update
sudo apt-get install libudev-dev libusb-1.0-0-dev
- name: Cache cargo registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
# Add date to the cache to keep it up to date
key: ${{ matrix.os }}-stable-cargo-registry-${{ hashFiles('**/Cargo.lock') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
${{ matrix.os }}-stable-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
${{ matrix.os }}-stable-cargo-registry-
- name: Cache cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/git
# Add date to the cache to keep it up to date
key: ${{ matrix.os }}-stable-cargo-index-${{ hashFiles('**/Cargo.lock') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
${{ matrix.os }}-stable-cargo-index-${{ hashFiles('**/Cargo.lock') }}
${{ matrix.os }}-stable-cargo-index-
- name: Cache cargo target
uses: actions/cache@v3
with:
path: target
# Add date to the cache to keep it up to date
key: ${{ matrix.os }}-stable-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
${{ matrix.os }}-stable-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
${{ matrix.os }}-stable-cargo-build-target-
- name: Start private tangle
uses: "./.github/actions/private-tangle/setup"
- name: Run tests
timeout-minutes: 60
uses: actions-rs/cargo@v1
with:
command: test
args: --tests --all-features -- --ignored
- name: Tear down private tangle
if: always()
uses: "./.github/actions/private-tangle/tear-down"