Skip to content

Commit 853de7a

Browse files
authored
Merge pull request #673 from hatoo/test-build
Test build on CI
2 parents dc0558d + 4cc0d1b commit 853de7a

File tree

2 files changed

+30
-10
lines changed

2 files changed

+30
-10
lines changed

Diff for: .github/workflows/release-pgo.yml

+20-10
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ name: Publish PGO
22

33
on:
44
push:
5+
branches:
6+
- master
57
tags:
68
- "*.*.*"
9+
pull_request:
710

811
jobs:
912
publish:
@@ -22,32 +25,39 @@ jobs:
2225
release_name: oha-windows-amd64-pgo.exe
2326
target: x86_64-pc-windows-msvc
2427
additional_args: ""
25-
- os: macos-latest
26-
artifact_name: oha
27-
release_name: oha-macos-amd64-pgo
28-
target: x86_64-apple-darwin
29-
additional_args: ""
30-
- os: macos-14
31-
artifact_name: oha
32-
release_name: oha-macos-arm64-pgo
33-
target: aarch64-apple-darwin
34-
additional_args: ""
28+
# - os: macos-latest
29+
# artifact_name: oha
30+
# release_name: oha-macos-amd64-pgo
31+
# target: x86_64-apple-darwin
32+
# additional_args: ""
33+
# - os: macos-14
34+
# artifact_name: oha
35+
# release_name: oha-macos-arm64-pgo
36+
# target: aarch64-apple-darwin
37+
# additional_args: ""
3538

3639
steps:
3740
- uses: ilammy/setup-nasm@v1
3841
- uses: actions/checkout@v4
3942
- name: Install musl-tools on Linux
4043
run: sudo apt-get update --yes && sudo apt-get install --yes musl-tools
4144
if: contains(matrix.target, 'musl')
45+
- uses: Swatinem/rust-cache@v2
4246
- uses: dtolnay/rust-toolchain@stable
4347
with:
4448
targets: ${{ matrix.target }}
4549
components: llvm-tools-preview
4650
- run: cargo install cargo-pgo --version 0.2.8
4751
- uses: oven-sh/setup-bun@v2
4852
- run: bun run pgo.js --target ${{ matrix.target }} ${{ matrix.additional_args }}
53+
- name: Upload
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: ${{ matrix.release_name }}
57+
path: target/${{ matrix.target }}/pgo/${{ matrix.artifact_name }}
4958
- name: Upload binaries to release
5059
uses: svenstaro/upload-release-action@v2
60+
if: startsWith(github.ref, 'refs/tags/v')
5161
with:
5262
repo_token: ${{ secrets.GITHUB_TOKEN }}
5363
file: target/${{ matrix.target }}/pgo/${{ matrix.artifact_name }}

Diff for: .github/workflows/release.yml

+10
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ name: Publish
22

33
on:
44
push:
5+
branches:
6+
- master
57
tags:
68
- "*.*.*"
9+
pull_request:
710

811
jobs:
912
publish:
@@ -44,13 +47,20 @@ jobs:
4447
- name: Install musl-tools on Linux
4548
run: sudo apt-get update --yes && sudo apt-get install --yes musl-tools
4649
if: contains(matrix.target, 'musl')
50+
- uses: Swatinem/rust-cache@v2
4751
- name: Build binary
4852
uses: houseabsolute/actions-rust-cross@v1
4953
with:
5054
command: build
5155
target: ${{ matrix.target }}
5256
args: --profile release-ci --target ${{ matrix.target }} --locked --no-default-features --features rustls ${{ matrix.additional_args }}
57+
- name: Upload
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: ${{ matrix.release_name }}
61+
path: target/${{ matrix.target }}/release-ci/${{ matrix.artifact_name }}
5362
- name: Upload binaries to release
63+
if: startsWith(github.ref, 'refs/tags/v')
5464
uses: svenstaro/upload-release-action@v2
5565
with:
5666
repo_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)