Skip to content

Commit a73b57b

Browse files
committed
ci
1 parent e3d0f98 commit a73b57b

File tree

2 files changed

+103
-0
lines changed

2 files changed

+103
-0
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
on:
2+
pull_request:
3+
branches: [master]
4+
push:
5+
branches: [master]
6+
7+
name: CI
8+
9+
jobs:
10+
fmt:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: actions-rs/toolchain@v1.0.7
16+
with:
17+
toolchain: 1.74.1
18+
components: rustfmt
19+
20+
- name: Run rustfmt
21+
run: cargo fmt -- --check
22+
23+
test:
24+
needs: [fmt]
25+
runs-on: ${{ matrix.os }}
26+
strategy:
27+
matrix:
28+
os:
29+
- ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
33+
- uses: actions-rs/toolchain@v1.0.7
34+
with:
35+
name: test-${{matrix.os}}
36+
toolchain: 1.74.1
37+
38+
- name: Run unit tests
39+
run: cargo test --locked --all-targets --workspace --all-features
40+
timeout-minutes: 10

.github/workflows/publish.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Release
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
tags:
9+
- v[0-9]+.*
10+
11+
jobs:
12+
create-release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: taiki-e/create-gh-release-action@v1
17+
with:
18+
# # (optional)
19+
# changelog: CHANGELOG.md
20+
# (required)
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
23+
upload-assets:
24+
needs: create-release
25+
strategy:
26+
matrix:
27+
include:
28+
- target: aarch64-apple-darwin
29+
os: macos-latest
30+
# - target: x86_64-unknown-linux-gnu
31+
# os: ubuntu-latest
32+
- target: x86_64-unknown-linux-gnu
33+
os: ubuntu-20.04
34+
- target: x86_64-apple-darwin
35+
os: macos-latest
36+
- target: universal-apple-darwin
37+
os: macos-latest
38+
- target: x86_64-pc-windows-msvc
39+
os: windows-latest
40+
- target: i686-pc-windows-msvc
41+
os: windows-latest
42+
- target: aarch64-pc-windows-msvc
43+
os: windows-latest
44+
runs-on: ${{ matrix.os }}
45+
env:
46+
ENABLE_RUNTIME_TESTS: false
47+
steps:
48+
- uses: actions/checkout@v4
49+
- name: Install musl-tools on Linux
50+
run: sudo apt-get update --yes && sudo apt-get install --yes musl-tools
51+
if: contains(matrix.target, 'musl')
52+
- name: Install tools
53+
run: sudo apt-get update --yes && sudo apt-get install --yes libxi-dev libx11-dev libxcb1 libxrandr2 libdbus-1-3 libxtst-dev
54+
if: contains(matrix.os, 'ubuntu')
55+
- uses: taiki-e/upload-rust-binary-action@v1
56+
with:
57+
# (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload.
58+
# Note that glob pattern is not supported yet.
59+
bin: minicode
60+
# (optional) Target triple, default is host triple.
61+
target: ${{ matrix.target }}
62+
# (required) GitHub token for uploading assets to GitHub Releases.
63+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)