Skip to content

Commit c411e68

Browse files
committed
test
1 parent 57b2cf5 commit c411e68

5 files changed

Lines changed: 315 additions & 212 deletions

File tree

.github/workflows/ci-reusable.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
name: Reusable CI workflow
3+
4+
on:
5+
workflow_call:
6+
7+
jobs:
8+
linux:
9+
runs-on: ubuntu-latest
10+
timeout-minutes: 15
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions-rust-lang/setup-rust-toolchain@v1
14+
with:
15+
components: clippy, rustfmt
16+
rustflags: ""
17+
target: x86_64-unknown-linux-gnu
18+
- uses: mamba-org/setup-micromamba@v2
19+
env:
20+
ACTIONS_STEP_DEBUG: true
21+
- run: sudo apt-get update && sudo apt-get install -y fish zsh
22+
- run: cargo test --all-features
23+
if: always()
24+
- run: cargo fmt --check
25+
if: always()
26+
- run: cargo clippy --all-targets
27+
if: always()
28+
- run: cargo build --release --all-features
29+
if: always()
30+
31+
windows:
32+
runs-on: windows-latest
33+
timeout-minutes: 15
34+
steps:
35+
- uses: actions/checkout@v4
36+
- uses: actions-rust-lang/setup-rust-toolchain@v1
37+
with:
38+
components: clippy, rustfmt
39+
rustflags: ""
40+
target: x86_64-pc-windows-msvc
41+
- uses: mamba-org/setup-micromamba@v2
42+
env:
43+
ACTIONS_STEP_DEBUG: true
44+
- run: cargo test --no-default-features --features=__test_powershell
45+
if: always()
46+
- run: cargo fmt --check
47+
if: always()
48+
- run: cargo clippy --all-targets
49+
if: always()
50+
- run: cargo build --release --features=__test_powershell
51+
if: always()

.github/workflows/ci.yml

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,47 +7,5 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
linux:
11-
runs-on: ubuntu-latest
12-
timeout-minutes: 15
13-
steps:
14-
- uses: actions/checkout@v4
15-
- uses: actions-rust-lang/setup-rust-toolchain@v1
16-
with:
17-
components: clippy, rustfmt
18-
rustflags: ""
19-
target: x86_64-unknown-linux-gnu
20-
- uses: mamba-org/setup-micromamba@v2
21-
env:
22-
ACTIONS_STEP_DEBUG: true
23-
- run: sudo apt-get update && sudo apt-get install -y fish zsh
24-
- run: cargo test --all-features
25-
if: always()
26-
- run: cargo fmt --check
27-
if: always()
28-
- run: cargo clippy --all-targets
29-
if: always()
30-
- run: cargo build --release --all-features
31-
if: always()
32-
33-
windows:
34-
runs-on: windows-latest
35-
timeout-minutes: 15
36-
steps:
37-
- uses: actions/checkout@v4
38-
- uses: actions-rust-lang/setup-rust-toolchain@v1
39-
with:
40-
components: clippy, rustfmt
41-
rustflags: ""
42-
target: x86_64-pc-windows-msvc
43-
- uses: mamba-org/setup-micromamba@v2
44-
env:
45-
ACTIONS_STEP_DEBUG: true
46-
- run: cargo test --no-default-features --features=__test_powershell
47-
if: always()
48-
- run: cargo fmt --check
49-
if: always()
50-
- run: cargo clippy --all-targets
51-
if: always()
52-
- run: cargo build --release --features=__test_powershell
53-
if: always()
10+
ci:
11+
uses: ./.github/workflows/ci-reusable.yml

.github/workflows/release.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
name: Release
3+
4+
on:
5+
push:
6+
tags:
7+
- '*'
8+
9+
jobs:
10+
ci:
11+
name: Run CI
12+
uses: ./.github/workflows/ci-reusable.yml
13+
14+
release:
15+
needs: ci
16+
runs-on: ${{ matrix.runs-on }}
17+
timeout-minutes: 15
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
include:
22+
- runs-on: windows-latest
23+
target: x86_64-pc-windows-msvc
24+
25+
- runs-on: windows-latest
26+
target: i686-pc-windows-msvc
27+
28+
- runs-on: windows-latest
29+
target: aarch64-pc-windows-msvc
30+
31+
- runs-on: ubuntu-latest
32+
target: x86_64-unknown-linux-musl
33+
34+
- runs-on: ubuntu-latest
35+
target: i686-unknown-linux-musl
36+
37+
- runs-on: ubuntu-latest
38+
target: aarch64-unknown-linux-musl
39+
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- uses: actions-rust-lang/setup-rust-toolchain@v1
44+
with:
45+
components: clippy, rustfmt
46+
rustflags: ""
47+
target: ${{ matrix.target }}
48+
49+
- name: Build
50+
run: cargo build --release --all-features --target=${{ matrix.target }}
51+
52+
- name: Create a zip (windows)
53+
if: ${{ matrix.runs-on == 'windows-latest' }}
54+
run: |
55+
mkdir release
56+
cp LICENSE release/
57+
cp target/${{ matrix.target }}/release/csm.exe release/
58+
Compress-Archive -Path release/* -DestinationPath csm-${{ github.ref_name }}-${{ matrix.target }}.zip
59+
echo "archive=csm-${{ github.ref_name }}-${{ matrix.target }}.zip" >> $GITHUB_OUTPUT
60+
61+
- name: Create a tar.gz (linux)
62+
if: ${{ matrix.runs-on == 'ubuntu-latest' }}
63+
run: |
64+
mkdir release
65+
cp LICENSE release/
66+
cp target/${{ matrix.target }}/release/csm release/
67+
tar -czvf csm-${{ github.ref_name }}-${{ matrix.target }}.tar.gz -C release .
68+
echo "archive=csm-${{ github.ref_name }}-${{ matrix.target }}.tar.gz" >> $GITHUB_OUTPUT
69+
70+
- name: debug - echo the archive
71+
run: echo ${{ steps.build.outputs.archive }}
72+
73+
- name: Release
74+
uses: softprops/action-gh-release@v2
75+
if: github.ref_type == 'tag'
76+
with:
77+
files: ${{ steps.build.outputs.archive }}

0 commit comments

Comments
 (0)