@@ -21,6 +21,16 @@ permissions:
2121 pull-requests : write
2222
2323jobs :
24+ commitlint :
25+ runs-on : ubuntu-latest
26+ if : github.ref != 'refs/heads/main'
27+ steps :
28+ - uses : actions/checkout@v6
29+ with :
30+ fetch-depth : 0
31+
32+ - uses : wagoid/commitlint-github-action@v6
33+
2434 linters :
2535 runs-on : ubuntu-latest
2636 timeout-minutes : 5
4353 tests-redis :
4454 runs-on : ubuntu-latest
4555 timeout-minutes : 10
56+ strategy :
57+ matrix :
58+ redis-version : ["7.x", "8.x"]
4659 steps :
4760 - uses : actions/checkout@v6
4861
6275 - name : Start Redis with SHIELD module
6376 uses : shogo82148/actions-setup-redis@v1
6477 with :
65- redis-version : " 8.x "
78+ redis-version : ${{ matrix.redis-version }}
6679 redis-port : " 34567"
6780 redis-conf : |
6881 loadmodule ${{ github.workspace }}/target/debug/libredis_shield.so
7386 tests-valkey :
7487 runs-on : ubuntu-latest
7588 timeout-minutes : 10
89+ strategy :
90+ matrix :
91+ redis-version : ["7.x", "8.x"]
7692 steps :
7793 - uses : actions/checkout@v6
7894
@@ -93,20 +109,45 @@ jobs:
93109 uses : shogo82148/actions-setup-redis@v1
94110 with :
95111 distribution : valkey
96- redis-version : " 8.x "
112+ redis-version : ${{ matrix.redis-version }}
97113 redis-port : " 34567"
98114 redis-conf : |
99115 loadmodule ${{ github.workspace }}/target/debug/libredis_shield.so
100116
101117 - name : Run tests
102118 run : just test
103119
104- commitlint :
105- runs-on : ubuntu-latest
106- if : github.ref != 'refs/heads/main'
120+ build-test :
121+ needs : [tests-redis, tests-valkey]
122+ timeout-minutes : 10
123+ strategy :
124+ fail-fast : false
125+ matrix :
126+ include :
127+ - target : x86_64-unknown-linux-gnu
128+ os : ubuntu-latest
129+ - target : x86_64-apple-darwin
130+ os : macos-latest
131+ - target : aarch64-apple-darwin
132+ os : macos-latest
133+ - target : aarch64-unknown-linux-gnu
134+ os : ubuntu-latest
135+ cross : true
136+ runs-on : ${{ matrix.os }}
107137 steps :
108138 - uses : actions/checkout@v6
139+
140+ - name : Setup cross-compilation toolchain
141+ if : matrix.cross
142+ uses : taiki-e/setup-cross-toolchain-action@v1
109143 with :
110- fetch-depth : 0
144+ target : ${{ matrix.target }}
111145
112- - uses : wagoid/commitlint-github-action@v6
146+ - name : Install rust toolchain
147+ uses : actions-rust-lang/setup-rust-toolchain@v1
148+ with :
149+ cache-key : ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('rust-toolchain.toml') }}-${{ hashFiles('Cargo.lock') }}
150+ target : ${{ matrix.target }}
151+
152+ - name : Build library
153+ run : cargo build --target ${{ matrix.target }}
0 commit comments