Skip to content

Commit d6179cc

Browse files
committed
help find cargo
1 parent de3e1b0 commit d6179cc

File tree

2 files changed

+109
-59
lines changed

2 files changed

+109
-59
lines changed

.github/workflows/build-template.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build Rust Binary
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
directory:
7+
required: true
8+
type: string
9+
artifact-name:
10+
required: true
11+
type: string
12+
binary-path:
13+
required: true
14+
type: string
15+
repository:
16+
required: false
17+
type: string
18+
ref:
19+
required: false
20+
type: string
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-22.04
25+
container:
26+
image: ubuntu:20.04
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
with:
31+
repository: ${{ inputs.repository || github.repository }}
32+
ref: ${{ inputs.ref || github.ref }}
33+
34+
- name: Install dependencies
35+
env:
36+
DEBIAN_FRONTEND: noninteractive
37+
run: apt-get update && apt-get -y install curl musl-tools pkg-config libc6 libgcc1 libpthread-stubs0-dev libdl1
38+
39+
- name: Install Rust toolchain
40+
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
41+
42+
- name: Build ${{ inputs.artifact-name }}
43+
run: $HOME/.cargo/bin/cargo build --release
44+
working-directory: ${{ inputs.directory }}
45+
46+
- uses: actions/upload-artifact@v4
47+
with:
48+
name: ${{ inputs.artifact-name }}
49+
path: ${{ inputs.binary-path }}
50+
if-no-files-found: error

.github/workflows/hil.yml

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -19,49 +19,33 @@ env:
1919
CARGO_TERM_COLOR: always
2020
RUST_LOG: debug
2121

22-
# Cancel any currently running workflows from the same PR, branch, or
23-
# tag when a new workflow is triggered.
24-
#
25-
# https://stackoverflow.com/a/66336834
2622
concurrency:
2723
cancel-in-progress: true
2824
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
2925

3026
jobs:
3127
build-espflash:
32-
name: Build espflash
33-
runs-on: ubuntu-22.04
34-
container:
35-
image: ubuntu:20.04
36-
37-
steps:
38-
- uses: actions/checkout@v4
39-
with:
40-
repository: ${{ github.event.inputs.repository || github.repository }}
41-
ref: ${{ github.event.inputs.branch || github.ref }}
42-
43-
- name: Install dependencies
44-
env:
45-
DEBIAN_FRONTEND: noninteractive
46-
run: apt-get update && apt-get -y install curl musl-tools pkg-config
47-
48-
- name: Install toolchain
49-
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
50-
51-
- name: Build espflash
52-
run: $HOME/.cargo/bin/cargo build --release
53-
working-directory: espflash
54-
55-
- uses: actions/upload-artifact@v4
56-
with:
57-
name: espflash
58-
path: target/release/espflash
59-
if-no-files-found: error
28+
uses: ./.github/workflows/build-template.yml
29+
with:
30+
directory: espflash
31+
artifact-name: espflash
32+
binary-path: target/release/espflash
33+
repository: ${{ github.event.inputs.repository || github.repository }}
34+
ref: ${{ github.event.inputs.branch || github.ref }}
35+
36+
build-xtask:
37+
uses: ./.github/workflows/build-template.yml
38+
with:
39+
directory: xtask
40+
artifact-name: xtask
41+
binary-path: target/release/xtask
42+
repository: ${{ github.event.inputs.repository || github.repository }}
43+
ref: ${{ github.event.inputs.branch || github.ref }}
6044

6145
run-target:
6246
if: github.repository_owner == 'esp-rs'
6347
name: ${{ matrix.board.mcu }}${{ matrix.board.freq }}
64-
needs: build-espflash
48+
needs: [build-espflash, build-xtask]
6549
runs-on:
6650
[
6751
self-hosted,
@@ -100,42 +84,58 @@ jobs:
10084
chmod +x espflash_app/espflash
10185
echo "$PWD/espflash_app" >> "$GITHUB_PATH"
10286
87+
- uses: actions/download-artifact@v4
88+
with:
89+
name: xtask
90+
path: xtask_app
91+
92+
- name: Set up xtask binary
93+
run: |
94+
chmod +x xtask_app/xtask
95+
echo "$PWD/xtask_app" >> "$GITHUB_PATH"
96+
10397
- name: Run all tests
104-
run: cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 60
98+
run: |
99+
pwd
100+
ls -l xtask_app/xtask
101+
file xtask_app/xtask
102+
ldd xtask_app/xtask
103+
./xtask_app/xtask --help
104+
# ./xtask_app/xtask run-tests --chip ${{ matrix.board.mcu }} -t 60
105105

106-
- name: board-info test
107-
run: cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 15 board-info
106+
# - name: board-info test
107+
# run: $HOME/.cargo/bin/cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 15 board-info
108108

109-
- name: flash test
110-
run: cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 90 flash
109+
# - name: flash test
110+
# run: $HOME/.cargo/bin/cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 90 flash
111111

112-
- name: monitor test
113-
run: cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 20 monitor
112+
# - name: monitor test
113+
# run: $HOME/.cargo/bin/cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 20 monitor
114114

115-
- name: erase-flash test
116-
run: cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 60 erase-flash
115+
# - name: erase-flash test
116+
# run: $HOME/.cargo/bin/cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 60 erase-flash
117117

118-
- name: save-image/write-bin test
119-
run: |
120-
cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 60 save-image_write-bin
118+
# - name: save-image/write-bin test
119+
# run:
120+
# $HOME/.cargo/bin/cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 60 save-image_write-bin
121121

122-
- name: erase-region test
123-
run: cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 60 erase-region
122+
# - name: erase-region test
123+
# run: $HOME/.cargo/bin/cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 60 erase-region
124124

125-
- name: hold-in-reset test
126-
run: cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 10 hold-in-reset
125+
# - name: hold-in-reset test
126+
# run: $HOME/.cargo/bin/cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 10 hold-in-reset
127127

128-
- name: reset test
129-
run: cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 10 reset
128+
# - name: reset test
129+
# run: $HOME/.cargo/bin/cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 10 reset
130130

131-
- name: checksum-md5 test
132-
run: cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 10 checksum-md5
131+
# - name: checksum-md5 test
132+
# run: $HOME/.cargo/bin/cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 10 checksum-md5
133133

134-
- name: list-ports test
135-
run: cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 10 list-ports
134+
# - name: list-ports test
135+
# run: $HOME/.cargo/bin/cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 10 list-ports
136136

137-
- name: write-bin test
138-
run: cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 30 write-bin
137+
# - name: write-bin test
138+
# run: $HOME/.cargo/bin/cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 30 write-bin
139139

140-
- name: read-flash test
141-
run: cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 60 read-flash
140+
# - name: read-flash test
141+
# run: $HOME/.cargo/bin/cargo xtask run-tests --chip ${{ matrix.board.mcu }} -t 60 read-flash

0 commit comments

Comments
 (0)