Skip to content

Commit 448beb8

Browse files
committed
Update CI config to something modern
1 parent 7a2dc6e commit 448beb8

File tree

1 file changed

+39
-110
lines changed

1 file changed

+39
-110
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -8,125 +8,54 @@ env:
88
RUST_BACKTRACE: 1
99

1010
jobs:
11-
test:
12-
name: Test - ${{ matrix.platform.os_name }} with rust ${{ matrix.toolchain }}
13-
runs-on: ${{ matrix.platform.os }}
11+
test-matrix:
12+
name: ${{ matrix.platform.os-name }} with rust ${{ matrix.toolchain }}
13+
runs-on: ${{ matrix.platform.runs-on }}
1414
strategy:
1515
fail-fast: false
1616
matrix:
1717
platform:
18-
- os_name: Linux
19-
os: ubuntu-latest
20-
target: x86_64-unknown-linux-gnu
21-
- os_name: macOS
22-
os: macOS-latest
23-
target: x86_64-apple-darwin
24-
- os_name: Windows
25-
os: windows-latest
18+
- os-name: Linux-x86_64
19+
runs-on: ubuntu-24.04
20+
target: x86_64-unknown-linux-musl
21+
- os-name: Linux-aarch64
22+
runs-on: ubuntu-24.04
23+
target: aarch64-unknown-linux-musl
24+
- os-name: Windows-x86_64
25+
runs-on: windows-latest
2626
target: x86_64-pc-windows-msvc
27+
- os-name: macOS-aarch64
28+
runs-on: macOS-latest
29+
target: aarch64-apple-darwin
2730
toolchain:
2831
- stable
29-
- beta
30-
- nightly
32+
include:
33+
- platform:
34+
os-name: Linux-x86_64
35+
runs-on: ubuntu-24.04
36+
target: x86_64-unknown-linux-musl
37+
bin: ubi
38+
toolchain: beta
39+
- platform:
40+
os-name: Linux-x86_64
41+
runs-on: ubuntu-24.04
42+
target: x86_64-unknown-linux-musl
43+
bin: ubi
44+
toolchain: nightly
3145
steps:
32-
- uses: actions/checkout@v2
33-
- name: Cache cargo & target directories
34-
uses: Swatinem/rust-cache@v2
35-
- name: Install toolchain
36-
uses: actions-rs/toolchain@v1
46+
- uses: actions/checkout@v6
47+
- name: Run tests
48+
uses: houseabsolute/actions-rust-cross@v1
3749
with:
38-
profile: default
50+
command: "test"
51+
target: ${{ matrix.platform.target }}
3952
toolchain: ${{ matrix.toolchain }}
40-
override: true
41-
- name: Run cargo check
42-
uses: actions-rs/cargo@v1
43-
with:
44-
command: check
45-
args: --target=${{ matrix.platform.target }}
46-
- name: Run install-dev-tools.sh
47-
shell: bash
48-
run: |
49-
set -e
50-
mkdir $HOME/bin
51-
./dev/bin/install-dev-tools.sh
52-
- name: Add $HOME/bin to $PATH
53-
shell: bash
54-
run: |
55-
echo "$HOME/bin" >> $GITHUB_PATH
56-
- name: Run cargo test
57-
uses: actions-rs/cargo@v1
53+
args: "--locked --release"
54+
if: ${{ !matrix.platform.skip-tests }}
55+
- name: Publish artifacts and release
56+
uses: houseabsolute/actions-rust-release@v0
5857
with:
59-
command: test
60-
args: --target=${{ matrix.platform.target }} --workspace
61-
62-
# Copied from https://github.com/urbica/martin/blob/master/.github/workflows/ci.yml
63-
release:
64-
name: Release - ${{ matrix.platform.os_name }}
65-
if: startsWith( github.ref, 'refs/tags/tailwindcss-to-rust-v' )
66-
needs: [test]
67-
strategy:
68-
matrix:
69-
platform:
70-
- os_name: Linux-x86_64
71-
os: ubuntu-20.04
72-
target: x86_64-unknown-linux-musl
73-
bin: tailwindcss-to-rust
74-
name: tailwindcss-to-rust-Linux-x86_64-musl.tar.gz
75-
cross: true
76-
- os_name: Windows
77-
os: windows-latest
78-
target: x86_64-pc-windows-msvc
79-
bin: tailwindcss-to-rust.exe
80-
name: tailwindcss-to-rust-Windows-x86_64.zip
81-
cross: false
82-
- os_name: macOS-x86_64
83-
os: macOS-latest
84-
target: x86_64-apple-darwin
85-
bin: tailwindcss-to-rust
86-
name: tailwindcss-to-rust-Darwin-x86_64.tar.gz
87-
cross: false
88-
- os_name: macOS-aarch64
89-
os: macOS-latest
90-
target: aarch64-apple-darwin
91-
bin: tailwindcss-to-rust
92-
name: tailwindcss-to-rust-Darwin-aarch64.tar.gz
93-
cross: false
94-
runs-on: ${{ matrix.platform.os }}
95-
steps:
96-
- name: Checkout
97-
uses: actions/checkout@v2
98-
- name: Install stable toolchain
99-
uses: actions-rs/toolchain@v1
100-
with:
101-
profile: minimal
102-
toolchain: stable
103-
override: true
58+
executable-name: ubi
10459
target: ${{ matrix.platform.target }}
105-
- name: Build binary
106-
uses: actions-rs/cargo@v1
107-
with:
108-
command: build
109-
args: --package tailwindcss-to-rust --release --target ${{ matrix.platform.target }}
110-
- name: Package as archive
111-
shell: bash
112-
run: |
113-
if [[ "${{ matrix.platform.cross }}" == "false" ]]; then
114-
# strip doesn't work with non-native binaries on Linux, AFAICT.
115-
strip target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}
116-
fi
117-
cd target/${{ matrix.platform.target }}/release
118-
if [[ "${{ matrix.platform.os }}" == "windows-latest" ]]; then
119-
7z a ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }}
120-
else
121-
tar czvf ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }}
122-
fi
123-
cd -
124-
- name: Generate SHA-256
125-
if: matrix.platform.os == 'macOS-latest'
126-
run: shasum -a 256 ${{ matrix.platform.name }}
127-
- name: Publish GitHub release
128-
uses: softprops/action-gh-release@v1
129-
with:
130-
draft: true
131-
files: "tailwindcss-to-rust*"
132-
body_path: generator/Changes.md
60+
action-gh-release-parameters: '{ "make_latest": false }'
61+
if: matrix.toolchain == 'stable' && matrix.platform.features == ''

0 commit comments

Comments
 (0)