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