aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/rust.yml56
1 files changed, 39 insertions, 17 deletions
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index 118143daa..69cd9ff14 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -95,21 +95,24 @@ jobs:
95 - uses: actions/checkout@v2 95 - uses: actions/checkout@v2
96 with: 96 with:
97 submodules: true 97 submodules: true
98 - uses: actions-rs/toolchain@v1 98 - uses: actions/cache@v2
99 with: 99 with:
100 toolchain: stable 100 path: |
101 - name: cache 101 ~/.cargo/bin/
102 id: cache-target 102 ~/.cargo/registry/index/
103 uses: actions/cache@v2 103 ~/.cargo/registry/cache/
104 with: 104 ~/.cargo/git/db/
105 path: target 105 target/
106 key: ${{ runner.os }}-${{ matrix.target }} 106 key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml') }}
107 restore-keys: |
108 ${{ runner.os }}-cargo-${{ matrix.target }}-
107 109
108 # We have to append the "-D warnings" flag to .cargo/config rather than 110 # We have to append the "-D warnings" flag to .cargo/config rather than
109 # using the RUSTFLAGS environment variable because if we set RUSTFLAGS 111 # using the RUSTFLAGS environment variable because if we set RUSTFLAGS
110 # cargo will ignore the rustflags config in .cargo/config. 112 # cargo will ignore the rustflags config in .cargo/config.
111 - name: Check 113 - name: Check
112 run: | 114 run: |
115 export CARGO_TARGET_DIR=$PWD/target
113 mkdir -p .cargo 116 mkdir -p .cargo
114 echo -e '[target."cfg(all())"]\nrustflags = ["-D", "warnings"]' >> .cargo/config 117 echo -e '[target."cfg(all())"]\nrustflags = ["-D", "warnings"]' >> .cargo/config
115 cd ${{ matrix.package }} && RUSTFLAGS=-Dwarnings cargo check --features=${{ matrix.features }} --target=${{ matrix.target }} 118 cd ${{ matrix.package }} && RUSTFLAGS=-Dwarnings cargo check --features=${{ matrix.features }} --target=${{ matrix.target }}
@@ -118,9 +121,6 @@ jobs:
118 runs-on: ubuntu-latest 121 runs-on: ubuntu-latest
119 steps: 122 steps:
120 - uses: actions/checkout@v2 123 - uses: actions/checkout@v2
121 - uses: actions-rs/toolchain@v1
122 with:
123 toolchain: stable
124 - name: Check fmt 124 - name: Check fmt
125 run: for i in embassy-*; do (cd $i; cargo fmt -- --check); done 125 run: for i in embassy-*; do (cd $i; cargo fmt -- --check); done
126 126
@@ -128,11 +128,22 @@ jobs:
128 runs-on: ubuntu-latest 128 runs-on: ubuntu-latest
129 steps: 129 steps:
130 - uses: actions/checkout@v2 130 - uses: actions/checkout@v2
131 - uses: actions-rs/toolchain@v1 131 - uses: actions/cache@v2
132 with: 132 with:
133 toolchain: stable 133 path: |
134 ~/.cargo/bin/
135 ~/.cargo/registry/index/
136 ~/.cargo/registry/cache/
137 ~/.cargo/git/db/
138 target/
139 key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
140 restore-keys: |
141 ${{ runner.os }}-cargo-
134 - name: Test 142 - name: Test
135 run: cd embassy && cargo test 143 run: |
144 export CARGO_TARGET_DIR=$PWD/target
145 cd embassy
146 cargo test
136 147
137 metapac_gen: 148 metapac_gen:
138 runs-on: ubuntu-latest 149 runs-on: ubuntu-latest
@@ -140,8 +151,19 @@ jobs:
140 - uses: actions/checkout@v2 151 - uses: actions/checkout@v2
141 with: 152 with:
142 submodules: true 153 submodules: true
143 - uses: actions-rs/toolchain@v1 154 - uses: actions/cache@v2
144 with: 155 with:
145 toolchain: stable 156 path: |
157 ~/.cargo/bin/
158 ~/.cargo/registry/index/
159 ~/.cargo/registry/cache/
160 ~/.cargo/git/db/
161 target/
162 key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
163 restore-keys: |
164 ${{ runner.os }}-cargo-
146 - name: Generate pregenerated metapac 165 - name: Generate pregenerated metapac
147 run: cd stm32-metapac-gen; cargo run --release 166 run: |
167 export CARGO_TARGET_DIR=$PWD/target
168 cd stm32-metapac-gen
169 cargo run --release