Skip to content

Commit 2755152

Browse files
committed
ci: run x-platform build tests only on merge to master
1 parent b99178c commit 2755152

File tree

2 files changed

+87
-81
lines changed

2 files changed

+87
-81
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
6+
name: X-Platform Compilation
7+
8+
jobs:
9+
build:
10+
name: ${{ matrix.job.target }} (${{ matrix.job.os }})
11+
runs-on: ${{ matrix.job.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
job:
16+
- { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04 }
17+
- { target: x86_64-apple-darwin , os: macos-10.15 }
18+
- { target: i686-pc-windows-msvc , os: windows-2019 }
19+
- { target: x86_64-pc-windows-gnu , os: windows-2019 }
20+
- { target: x86_64-pc-windows-msvc , os: windows-2019 }
21+
22+
steps:
23+
- name: Checkout source code
24+
uses: actions/checkout@v2
25+
26+
- name: Install prerequisites
27+
shell: bash
28+
run: |
29+
case ${{ matrix.job.target }} in
30+
arm-unknown-linux-*) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;;
31+
aarch64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ;;
32+
esac
33+
34+
- name: Install packages (Ubuntu)
35+
if: matrix.job.os == 'ubuntu-20.04'
36+
run: |
37+
sudo apt update
38+
sudo apt install libudev-dev pkg-config
39+
40+
- name: Extract crate information
41+
shell: bash
42+
run: |
43+
echo "PROJECT_NAME=$(sed -n 's/^name = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> $GITHUB_ENV
44+
echo "PROJECT_VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> $GITHUB_ENV
45+
46+
- name: Install Rust toolchain
47+
uses: actions-rs/toolchain@v1
48+
with:
49+
toolchain: stable
50+
target: ${{ matrix.job.target }}
51+
override: true
52+
profile: minimal
53+
54+
- name: Show installed version information (Rust, cargo, GCC,...)
55+
shell: bash
56+
run: |
57+
gcc --version || true
58+
rustup -V
59+
rustup toolchain list
60+
rustup default
61+
cargo -V
62+
rustc -V
63+
64+
- uses: Swatinem/rust-cache@v1
65+
with:
66+
cache-on-failure: true
67+
68+
- name: Build foundry and call crates
69+
uses: actions-rs/cargo@v1
70+
with:
71+
use-cross: ${{ matrix.job.use-cross }}
72+
command: build
73+
args: --verbose --workspace
74+
75+
- name: Run forge
76+
uses: actions-rs/cargo@v1
77+
with:
78+
use-cross: ${{ matrix.job.use-cross }}
79+
command: run
80+
args: -p foundry-cli --bin forge -- --help
81+
82+
- name: Run tests
83+
uses: actions-rs/cargo@v1
84+
with:
85+
use-cross: ${{ matrix.job.use-cross }}
86+
command: test
87+
args: --verbose --workspace

.github/workflows/unit-tests.yml

Lines changed: 0 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -57,84 +57,3 @@ jobs:
5757

5858
- name: cargo clippy
5959
run: cargo +nightly clippy --all --all-features -- -D warnings
60-
61-
62-
build:
63-
name: ${{ matrix.job.target }} (${{ matrix.job.os }})
64-
runs-on: ${{ matrix.job.os }}
65-
strategy:
66-
fail-fast: false
67-
matrix:
68-
job:
69-
- { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04 }
70-
- { target: x86_64-apple-darwin , os: macos-10.15 }
71-
- { target: i686-pc-windows-msvc , os: windows-2019 }
72-
- { target: x86_64-pc-windows-gnu , os: windows-2019 }
73-
- { target: x86_64-pc-windows-msvc , os: windows-2019 }
74-
75-
steps:
76-
- name: Checkout source code
77-
uses: actions/checkout@v2
78-
79-
- name: Install prerequisites
80-
shell: bash
81-
run: |
82-
case ${{ matrix.job.target }} in
83-
arm-unknown-linux-*) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;;
84-
aarch64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ;;
85-
esac
86-
87-
- name: Install packages (Ubuntu)
88-
if: matrix.job.os == 'ubuntu-20.04'
89-
run: |
90-
sudo apt update
91-
sudo apt install libudev-dev pkg-config
92-
93-
- name: Extract crate information
94-
shell: bash
95-
run: |
96-
echo "PROJECT_NAME=$(sed -n 's/^name = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> $GITHUB_ENV
97-
echo "PROJECT_VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> $GITHUB_ENV
98-
99-
- name: Install Rust toolchain
100-
uses: actions-rs/toolchain@v1
101-
with:
102-
toolchain: stable
103-
target: ${{ matrix.job.target }}
104-
override: true
105-
profile: minimal
106-
107-
- name: Show installed version information (Rust, cargo, GCC,...)
108-
shell: bash
109-
run: |
110-
gcc --version || true
111-
rustup -V
112-
rustup toolchain list
113-
rustup default
114-
cargo -V
115-
rustc -V
116-
117-
- uses: Swatinem/rust-cache@v1
118-
with:
119-
cache-on-failure: true
120-
121-
- name: Build foundry and call crates
122-
uses: actions-rs/cargo@v1
123-
with:
124-
use-cross: ${{ matrix.job.use-cross }}
125-
command: build
126-
args: --verbose --workspace
127-
128-
- name: Run forge
129-
uses: actions-rs/cargo@v1
130-
with:
131-
use-cross: ${{ matrix.job.use-cross }}
132-
command: run
133-
args: -p foundry-cli --bin forge -- --help
134-
135-
- name: Run tests without --default-features to avoid solc-asm being used
136-
uses: actions-rs/cargo@v1
137-
with:
138-
use-cross: ${{ matrix.job.use-cross }}
139-
command: test
140-
args: --verbose --workspace

0 commit comments

Comments
 (0)