|
1 | 1 | name: Pony Build |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: ["main"] |
6 | | - pull_request: |
7 | | - branches: ["main"] |
| 4 | + push: |
| 5 | + branches: [ "main" ] |
| 6 | + pull_request: |
| 7 | + branches: [ "main" ] |
8 | 8 |
|
9 | 9 | env: |
10 | | - CARGO_TERM_COLOR: always |
| 10 | + CARGO_TERM_COLOR: always |
11 | 11 |
|
12 | 12 | jobs: |
13 | | - build-agent: |
14 | | - runs-on: ubuntu-22.04 |
15 | | - strategy: |
16 | | - matrix: |
17 | | - target: |
18 | | - - x86_64-unknown-linux-gnu |
19 | | - - aarch64-unknown-linux-gnu |
20 | | - - armv7-unknown-linux-gnueabihf |
21 | | - |
22 | | - steps: |
23 | | - - name: Checkout |
24 | | - uses: actions/checkout@v4 |
25 | | - |
26 | | - - name: Install latest rust toolchain |
27 | | - uses: actions-rs/toolchain@v1 |
28 | | - with: |
29 | | - toolchain: nightly |
30 | | - default: true |
31 | | - override: true |
32 | | - |
33 | | - - name: Update apt package index |
34 | | - run: sudo apt-get update |
35 | | - |
36 | | - - name: Install protobuf-compiler |
37 | | - run: sudo apt-get install -y protobuf-compiler |
38 | | - |
39 | | - - name: Install zig |
40 | | - run: pip3 install ziglang |
41 | | - |
42 | | - - name: Install cargo-zigbuild |
43 | | - run: cargo install --locked cargo-zigbuild |
44 | | - |
45 | | - - name: Add target |
46 | | - run: rustup target add ${{ matrix.target }} |
47 | | - |
48 | | - - name: Build for ${{ matrix.target }} |
49 | | - run: cargo zigbuild --release --bin agent --no-default-features --target ${{ matrix.target }} |
50 | | - |
51 | | - - name: Upload binary for ${{ matrix.target }} |
52 | | - uses: actions/upload-artifact@v4 |
53 | | - with: |
54 | | - name: pony-agent-${{ matrix.target }} |
55 | | - path: target/${{ matrix.target }}/release/agent |
56 | | - |
57 | | - build-api: |
58 | | - runs-on: ubuntu-22.04 |
59 | | - steps: |
60 | | - - name: Checkout |
61 | | - uses: actions/checkout@v4 |
62 | | - |
63 | | - - name: Install latest rust toolchain |
64 | | - uses: actions-rs/toolchain@v1 |
65 | | - with: |
66 | | - toolchain: nightly |
67 | | - default: true |
68 | | - override: true |
69 | | - |
70 | | - - name: Update apt package index |
71 | | - run: sudo apt-get update |
72 | | - |
73 | | - - name: Install protobuf-compiler |
74 | | - run: sudo apt-get install -y protobuf-compiler |
75 | | - |
76 | | - - name: Build API |
77 | | - run: cargo build --release --bin api --no-default-features |
78 | | - |
79 | | - - name: Upload API binary |
80 | | - uses: actions/upload-artifact@v4 |
81 | | - with: |
82 | | - name: pony-api |
83 | | - path: target/release/api |
84 | | - |
85 | | - build-auth: |
86 | | - runs-on: ubuntu-22.04 |
87 | | - steps: |
88 | | - - name: Checkout |
89 | | - uses: actions/checkout@v4 |
90 | | - |
91 | | - - name: Install latest rust toolchain |
92 | | - uses: actions-rs/toolchain@v1 |
93 | | - with: |
94 | | - toolchain: nightly |
95 | | - default: true |
96 | | - override: true |
97 | | - |
98 | | - - name: Update apt package index |
99 | | - run: sudo apt-get update |
100 | | - |
101 | | - - name: Install protobuf-compiler |
102 | | - run: sudo apt-get install -y protobuf-compiler |
103 | | - |
104 | | - - name: Build API |
105 | | - run: cargo build --release --bin auth --no-default-features |
106 | | - |
107 | | - - name: Upload API binary |
108 | | - uses: actions/upload-artifact@v4 |
109 | | - with: |
110 | | - name: pony-auth |
111 | | - path: target/release/auth |
112 | | - |
113 | | - collect-binaries: |
114 | | - runs-on: ubuntu-latest |
115 | | - needs: [build-agent, build-api] |
116 | | - |
117 | | - steps: |
118 | | - - name: Download agent x86_64 |
119 | | - uses: actions/download-artifact@v4 |
120 | | - with: |
121 | | - name: pony-agent-x86_64-unknown-linux-gnu |
122 | | - path: collected/x86_64 |
123 | | - |
124 | | - - name: Download agent arm64 |
125 | | - uses: actions/download-artifact@v4 |
126 | | - with: |
127 | | - name: pony-agent-aarch64-unknown-linux-gnu |
128 | | - path: collected/arm64 |
129 | | - |
130 | | - - name: Download agent armv7 |
131 | | - uses: actions/download-artifact@v4 |
132 | | - with: |
133 | | - name: pony-agent-armv7-unknown-linux-gnueabihf |
134 | | - path: collected/armv7 |
135 | | - |
136 | | - - name: Download api |
137 | | - uses: actions/download-artifact@v4 |
138 | | - with: |
139 | | - name: pony-api |
140 | | - path: collected/api |
141 | | - |
142 | | - - name: Download auth |
143 | | - uses: actions/download-artifact@v4 |
144 | | - with: |
145 | | - name: pony-auth |
146 | | - path: collected/auth |
147 | | - |
148 | | - - name: Upload combined binaries |
149 | | - uses: actions/upload-artifact@v4 |
150 | | - with: |
151 | | - name: pony-binaries |
152 | | - path: collected/ |
| 13 | + build-agent: |
| 14 | + runs-on: ubuntu-22.04 |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + target: |
| 18 | + - x86_64-unknown-linux-gnu |
| 19 | + - aarch64-unknown-linux-gnu |
| 20 | + - armv7-unknown-linux-gnueabihf |
| 21 | + |
| 22 | + steps: |
| 23 | + - name: Checkout |
| 24 | + uses: actions/checkout@v4 |
| 25 | + |
| 26 | + - name: Install latest rust toolchain |
| 27 | + uses: actions-rs/toolchain@v1 |
| 28 | + with: |
| 29 | + toolchain: nightly |
| 30 | + default: true |
| 31 | + override: true |
| 32 | + |
| 33 | + - name: Update apt package index |
| 34 | + run: sudo apt-get update |
| 35 | + |
| 36 | + - name: Install protobuf-compiler |
| 37 | + run: sudo apt-get install -y protobuf-compiler |
| 38 | + |
| 39 | + - name: Install zig |
| 40 | + run: pip3 install ziglang |
| 41 | + |
| 42 | + - name: Install cargo-zigbuild |
| 43 | + run: cargo install --locked cargo-zigbuild |
| 44 | + |
| 45 | + - name: Add target |
| 46 | + run: rustup target add ${{ matrix.target }} |
| 47 | + |
| 48 | + - name: Build for ${{ matrix.target }} |
| 49 | + run: cargo zigbuild --release --bin agent --no-default-features --target ${{ matrix.target }} |
| 50 | + |
| 51 | + - name: Upload binary for ${{ matrix.target }} |
| 52 | + uses: actions/upload-artifact@v4 |
| 53 | + with: |
| 54 | + name: pony-agent-${{ matrix.target }} |
| 55 | + path: target/${{ matrix.target }}/release/agent |
| 56 | + |
| 57 | + test-api: |
| 58 | + runs-on: ubuntu-22.04 |
| 59 | + steps: |
| 60 | + - name: Checkout |
| 61 | + uses: actions/checkout@v4 |
| 62 | + |
| 63 | + - name: Install latest rust toolchain |
| 64 | + uses: actions-rs/toolchain@v1 |
| 65 | + with: |
| 66 | + toolchain: nightly |
| 67 | + default: true |
| 68 | + override: true |
| 69 | + |
| 70 | + - name: Update apt package index |
| 71 | + run: sudo apt-get update |
| 72 | + |
| 73 | + - name: Install protobuf-compiler |
| 74 | + run: sudo apt-get install -y protobuf-compiler |
| 75 | + |
| 76 | + - name: Test API |
| 77 | + run: cargo test |
| 78 | + |
| 79 | + build-api: |
| 80 | + runs-on: ubuntu-22.04 |
| 81 | + needs: [ test-api ] |
| 82 | + steps: |
| 83 | + - name: Checkout |
| 84 | + uses: actions/checkout@v4 |
| 85 | + |
| 86 | + - name: Install latest rust toolchain |
| 87 | + uses: actions-rs/toolchain@v1 |
| 88 | + with: |
| 89 | + toolchain: nightly |
| 90 | + default: true |
| 91 | + override: true |
| 92 | + |
| 93 | + - name: Update apt package index |
| 94 | + run: sudo apt-get update |
| 95 | + |
| 96 | + - name: Install protobuf-compiler |
| 97 | + run: sudo apt-get install -y protobuf-compiler |
| 98 | + |
| 99 | + - name: Build API |
| 100 | + run: cargo build --release --bin api --no-default-features |
| 101 | + |
| 102 | + - name: Upload API binary |
| 103 | + uses: actions/upload-artifact@v4 |
| 104 | + with: |
| 105 | + name: pony-api |
| 106 | + path: target/release/api |
| 107 | + |
| 108 | + build-auth: |
| 109 | + runs-on: ubuntu-22.04 |
| 110 | + steps: |
| 111 | + - name: Checkout |
| 112 | + uses: actions/checkout@v4 |
| 113 | + |
| 114 | + - name: Install latest rust toolchain |
| 115 | + uses: actions-rs/toolchain@v1 |
| 116 | + with: |
| 117 | + toolchain: nightly |
| 118 | + default: true |
| 119 | + override: true |
| 120 | + |
| 121 | + - name: Update apt package index |
| 122 | + run: sudo apt-get update |
| 123 | + |
| 124 | + - name: Install protobuf-compiler |
| 125 | + run: sudo apt-get install -y protobuf-compiler |
| 126 | + |
| 127 | + - name: Build API |
| 128 | + run: cargo build --release --bin auth --no-default-features |
| 129 | + |
| 130 | + - name: Upload API binary |
| 131 | + uses: actions/upload-artifact@v4 |
| 132 | + with: |
| 133 | + name: pony-auth |
| 134 | + path: target/release/auth |
| 135 | + |
| 136 | + collect-binaries: |
| 137 | + runs-on: ubuntu-latest |
| 138 | + needs: [ build-agent, build-api ] |
| 139 | + |
| 140 | + steps: |
| 141 | + - name: Download agent x86_64 |
| 142 | + uses: actions/download-artifact@v4 |
| 143 | + with: |
| 144 | + name: pony-agent-x86_64-unknown-linux-gnu |
| 145 | + path: collected/x86_64 |
| 146 | + |
| 147 | + - name: Download agent arm64 |
| 148 | + uses: actions/download-artifact@v4 |
| 149 | + with: |
| 150 | + name: pony-agent-aarch64-unknown-linux-gnu |
| 151 | + path: collected/arm64 |
| 152 | + |
| 153 | + - name: Download agent armv7 |
| 154 | + uses: actions/download-artifact@v4 |
| 155 | + with: |
| 156 | + name: pony-agent-armv7-unknown-linux-gnueabihf |
| 157 | + path: collected/armv7 |
| 158 | + |
| 159 | + - name: Download api |
| 160 | + uses: actions/download-artifact@v4 |
| 161 | + with: |
| 162 | + name: pony-api |
| 163 | + path: collected/api |
| 164 | + |
| 165 | + - name: Download auth |
| 166 | + uses: actions/download-artifact@v4 |
| 167 | + with: |
| 168 | + name: pony-auth |
| 169 | + path: collected/auth |
| 170 | + |
| 171 | + - name: Upload combined binaries |
| 172 | + uses: actions/upload-artifact@v4 |
| 173 | + with: |
| 174 | + name: pony-binaries |
| 175 | + path: collected/ |
0 commit comments