Skip to content

Commit 289f516

Browse files
committed
Update github workflow
1 parent 26fde6b commit 289f516

File tree

1 file changed

+65
-106
lines changed

1 file changed

+65
-106
lines changed

.github/workflows/main.yml

Lines changed: 65 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -7,135 +7,94 @@ jobs:
77
runs-on: ${{ matrix.os }}
88
strategy:
99
matrix:
10-
thing:
11-
- stable
12-
- macos-x86_64
13-
- i686-linux
14-
- arm-linux
15-
- x86_64-mingw
16-
- x86_64-msvc
10+
target:
11+
- x86_64-unknown-linux-gnu
12+
- i686-unknown-linux-gnu
13+
- x86_64-pc-windows-gnu
14+
- arm-unknown-linux-gnueabi
15+
- x86_64-apple-darwin
16+
- x86_64-pc-windows-msvc
17+
rust: [stable]
18+
lua: [lua54, lua53, lua52, lua51]
1719
include:
18-
- thing: stable
19-
target: x86_64-unknown-linux-gnu
20-
rust: stable
21-
os: ubuntu-latest
22-
- thing: macos-x86_64
23-
target: x86_64-apple-darwin
24-
rust: stable
20+
- target: x86_64-unknown-linux-gnu
21+
os: ubuntu-18.04
22+
- target: i686-unknown-linux-gnu
23+
os: ubuntu-18.04
24+
- target: x86_64-pc-windows-gnu
25+
os: ubuntu-18.04
26+
- target: arm-unknown-linux-gnueabi
27+
os: ubuntu-18.04
28+
- target: x86_64-apple-darwin
2529
os: macos-latest
26-
- thing: i686-linux
27-
target: i686-unknown-linux-gnu
28-
rust: stable
29-
os: ubuntu-latest
30-
- thing: arm-linux
31-
target: arm-unknown-linux-gnueabi
32-
rust: stable
33-
os: ubuntu-latest
34-
- thing: x86_64-mingw
35-
target: x86_64-pc-windows-gnu
36-
rust: stable
37-
os: ubuntu-latest
38-
- thing: x86_64-msvc
39-
target: x86_64-pc-windows-msvc
40-
rust: stable-x86_64-msvc
30+
- target: x86_64-pc-windows-msvc
4131
os: windows-latest
4232
steps:
43-
- uses: actions/checkout@v1
44-
- name: Install Rust (rustup)
45-
if: matrix.os != 'macos-latest'
46-
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
47-
shell: bash
48-
- name: Install Rust (macos)
49-
if: matrix.os == 'macos-latest'
50-
run: |
51-
curl https://sh.rustup.rs | sh -s -- -y
52-
echo ::add-path::$HOME/.cargo/bin
53-
shell: bash
54-
- name: Install GCC (i686-linux)
33+
- uses: actions/checkout@v2
34+
- uses: actions-rs/toolchain@v1
35+
with:
36+
toolchain: ${{ matrix.rust }}
37+
target: ${{ matrix.target }}
38+
override: false
39+
- name: Install GCC (i686-unknown-linux-gnu)
40+
if: ${{ matrix.target == 'i686-unknown-linux-gnu' }}
5541
run: |
5642
sudo apt-get update -y
5743
sudo apt-get install -y --no-install-recommends gcc-multilib
58-
if: matrix.thing == 'i686-linux'
59-
shell: bash
60-
- name: Install GCC (arm-linux)
61-
run: |
62-
sudo apt-get update -y
63-
sudo apt-get install -y --no-install-recommends gcc-arm-linux-gnueabi libc6-dev-armel-cross
64-
if: matrix.thing == 'arm-linux'
6544
shell: bash
66-
- name: Install GCC (x86_64-mingw)
45+
- name: Install GCC (x86_64-pc-windows-gnu)
46+
if: ${{ matrix.target == 'x86_64-pc-windows-gnu' }}
6747
run: |
6848
sudo apt-get update -y
6949
sudo apt-get install -y --no-install-recommends gcc-mingw-w64-x86-64
70-
if: matrix.thing == 'x86_64-mingw'
71-
shell: bash
72-
- run: rustup target add ${{ matrix.target }}
73-
- name: Build
74-
run: |
75-
for FEATURE in lua51 lua52 lua53 lua54; do
76-
echo "Building $FEATURE"
77-
cargo build --manifest-path testcrate/Cargo.toml --target ${{ matrix.target }} --release --no-default-features --features $FEATURE
78-
done
79-
shell: bash
80-
81-
test_linux:
82-
name: Test on Linux
83-
runs-on: ubuntu-latest
84-
needs: build
85-
steps:
86-
- uses: actions/checkout@v1
87-
- name: Install Rust
88-
run: rustup update stable --no-self-update && rustup default stable
8950
shell: bash
90-
- name: Run tests
51+
- name: Install GCC (arm-unknown-linux-gnueabi)
52+
if: ${{ matrix.target == 'arm-unknown-linux-gnueabi' }}
9153
run: |
92-
for FEATURE in lua51 lua52 lua53 lua54; do
93-
echo "Testing $FEATURE"
94-
cargo test --manifest-path testcrate/Cargo.toml --release --no-default-features --features $FEATURE
95-
done
96-
shell: bash
97-
98-
test_macos:
99-
name: Test on MacOS
100-
runs-on: macos-latest
101-
needs: build
102-
steps:
103-
- uses: actions/checkout@v1
104-
- name: Install Rust
105-
run: |
106-
curl https://sh.rustup.rs | sh -s -- -y
107-
echo ::add-path::$HOME/.cargo/bin
54+
sudo apt-get update -y
55+
sudo apt-get install -y --no-install-recommends gcc-arm-linux-gnueabi libc6-dev-armel-cross
10856
shell: bash
109-
- name: Run tests
57+
- name: Build ${{ matrix.lua }}
11058
run: |
111-
for FEATURE in lua51 lua52 lua53 lua54; do
112-
echo "Testing $FEATURE"
113-
cargo test --manifest-path testcrate/Cargo.toml --release --no-default-features --features $FEATURE
114-
done
59+
cargo build --manifest-path testcrate/Cargo.toml --target ${{ matrix.target }} --release --no-default-features --features ${{ matrix.lua }}
11560
shell: bash
11661

117-
test_windows:
118-
name: Test on Windows
119-
runs-on: windows-latest
62+
test:
63+
name: Test
64+
runs-on: ${{ matrix.os }}
12065
needs: build
66+
strategy:
67+
matrix:
68+
os: [ubuntu-18.04, macos-latest, windows-latest]
69+
rust: [stable]
70+
lua: [lua54, lua53, lua52, lua51]
71+
include:
72+
- os: ubuntu-18.04
73+
target: x86_64-unknown-linux-gnu
74+
- os: macos-latest
75+
target: x86_64-apple-darwin
76+
- os: windows-latest
77+
target: x86_64-pc-windows-msvc
12178
steps:
122-
- uses: actions/checkout@v1
123-
- name: Install Rust
124-
run: rustup update stable --no-self-update && rustup default stable
125-
shell: bash
126-
- name: Run tests
79+
- uses: actions/checkout@v2
80+
- uses: actions-rs/toolchain@v1
81+
with:
82+
toolchain: ${{ matrix.rust }}
83+
target: ${{ matrix.target }}
84+
override: true
85+
- name: Run ${{ matrix.lua }} tests
12786
run: |
128-
for FEATURE in lua51 lua52 lua53 lua54; do
129-
echo "Testing $FEATURE"
130-
cargo test --manifest-path testcrate/Cargo.toml --release --no-default-features --features $FEATURE
131-
done
87+
cargo test --manifest-path testcrate/Cargo.toml --release --no-default-features --features ${{ matrix.lua }}
13288
shell: bash
13389

13490
rustfmt:
13591
name: Rustfmt
136-
runs-on: ubuntu-latest
92+
runs-on: ubuntu-18.04
13793
steps:
138-
- uses: actions/checkout@v1
139-
- name: Install Rust
140-
run: rustup update stable && rustup default stable && rustup component add rustfmt
94+
- uses: actions/checkout@v2
95+
- uses: actions-rs/toolchain@v1
96+
with:
97+
toolchain: stable
98+
components: rustfmt
99+
override: true
141100
- run: cargo fmt -- --check

0 commit comments

Comments
 (0)