Skip to content

Commit 7f2d510

Browse files
ci: add linux/mac/integration tests on GHA
1 parent e8da49a commit 7f2d510

File tree

4 files changed

+178
-5
lines changed

4 files changed

+178
-5
lines changed

.github/workflows/integration.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: integration
2+
on: [push, pull_request]
3+
4+
jobs:
5+
integration-tests:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
integration: [
11+
bitflags,
12+
chalk,
13+
crater,
14+
error-chain,
15+
glob,
16+
log,
17+
mdbook,
18+
packed_simd,
19+
rust-semverver,
20+
stdsimd,
21+
tempdir,
22+
futures-rs,
23+
rust-clippy,
24+
failure,
25+
]
26+
include:
27+
# Allowed Failures
28+
# Actions doesn't yet support explicitly marking matrix legs as allowed failures
29+
# https://github.community/t5/GitHub-Actions/continue-on-error-allow-failure-UI-indication/td-p/37033
30+
# https://github.community/t5/GitHub-Actions/Why-a-matrix-step-will-be-canceled-if-another-one-failed/td-p/30920
31+
# Instead, leverage `continue-on-error`
32+
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error
33+
#
34+
# Using old rustfmt configuration option
35+
- integration: rand
36+
allow-failure: true
37+
# Keep this as an allowed failure as it's fragile to breaking changes of rustc.
38+
- integration: rust-clippy
39+
allow-failure: true
40+
# Using old rustfmt configuration option
41+
- integration: packed_simd
42+
allow-failure: true
43+
# calebcartwright (2019-12-24)
44+
# Keeping this as an allowed failure since it was flagged as such in the TravisCI config, even though
45+
# it appears to have been passing for quite some time.
46+
# Original comment was: temporal build failure due to breaking changes in the nightly compiler
47+
- integration: rust-semverver
48+
allow-failure: true
49+
# Can be moved back to include section after https://github.com/rust-lang-nursery/failure/pull/298 is merged
50+
- integration: failure
51+
allow-failure: true
52+
53+
steps:
54+
- name: checkout
55+
uses: actions/checkout@v2
56+
57+
# Run build
58+
- name: setup
59+
uses: actions-rs/toolchain@v1
60+
with:
61+
toolchain: nightly-x86_64-unknown-linux-gnu
62+
target: x86_64-unknown-linux-gnu
63+
override: true
64+
profile: minimal
65+
default: true
66+
- name: run integration tests
67+
env:
68+
INTEGRATION: ${{ matrix.integration }}
69+
run: ./ci/integration.sh
70+
continue-on-error: ${{ matrix.allow-failure == true }}

.github/workflows/linux.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: linux
2+
on: [push, pull_request]
3+
4+
jobs:
5+
test:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
target: [
11+
x86_64-unknown-linux-gnu,
12+
]
13+
channel: [ nightly ]
14+
cfg-release-channel: [
15+
beta,
16+
nightly,
17+
]
18+
19+
env:
20+
CFG_RELEASE_CHANNEL: ${{ matrix.cfg-release-channel }}
21+
22+
steps:
23+
- name: checkout
24+
uses: actions/checkout@v2
25+
26+
# Run build
27+
- name: setup
28+
uses: actions-rs/toolchain@v1
29+
with:
30+
toolchain: ${{ matrix.channel }}-${{ matrix.target }}
31+
target: ${{ matrix.target }}
32+
override: true
33+
profile: minimal
34+
default: true
35+
- name: build
36+
run: |
37+
rustc -Vv
38+
cargo -V
39+
cargo build
40+
- name: test
41+
run: cargo test
42+
- name: 'test ignored'
43+
run: cargo test -- --ignored

.github/workflows/mac.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: mac
2+
on: [push, pull_request]
3+
4+
jobs:
5+
test:
6+
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources
7+
# macOS Catalina 10.15
8+
runs-on: macos-latest
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
target: [
13+
x86_64-apple-darwin,
14+
]
15+
channel: [ nightly ]
16+
17+
steps:
18+
- name: checkout
19+
uses: actions/checkout@v2
20+
21+
# Run build
22+
- name: setup
23+
uses: actions-rs/toolchain@v1
24+
with:
25+
toolchain: ${{ matrix.channel }}-${{ matrix.target }}
26+
target: ${{ matrix.target }}
27+
override: true
28+
profile: minimal
29+
default: true
30+
- name: build
31+
run: |
32+
rustc -Vv
33+
cargo -V
34+
cargo build
35+
- name: test
36+
run: cargo test
37+
- name: 'test ignored'
38+
run: cargo test -- --ignored

.github/workflows/windows.yml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ jobs:
1414
x86_64-pc-windows-msvc,
1515
]
1616
channel: [ nightly ]
17+
include:
18+
- channel: nightly
19+
target: i686-pc-windows-gnu
20+
mingw-7z-path: mingw
1721

1822
steps:
1923
# The Windows runners have autocrlf enabled by default
@@ -22,6 +26,7 @@ jobs:
2226
run: git config --global core.autocrlf false
2327
- name: checkout
2428
uses: actions/checkout@v2
29+
2530
# The Windows runners do not (yet) have a proper msys/mingw environment
2631
# pre-configured like AppVeyor does, though they will likely be added in the future.
2732
# https://github.com/actions/virtual-environments/issues/30
@@ -32,16 +37,33 @@ jobs:
3237
# package and numworks/setup-msys2 action.
3338
# https://github.com/rust-lang/rust/blob/master/src/ci/scripts/install-mingw.sh#L59
3439
# https://github.com/rust-lang/rustup/blob/master/appveyor.yml
35-
- name: install mingw32
40+
#
41+
# Use GitHub Actions cache support to avoid downloading the .7z file every time
42+
# to be cognizant of the AWS egress cost impacts
43+
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy
44+
- name: cache mingw.7z
45+
id: cache-mingw
46+
with:
47+
path: ${{ matrix.mingw-7z-path }}
48+
key: ${{ matrix.channel }}-${{ matrix.target }}-mingw
49+
uses: actions/cache@v1
50+
if: matrix.target == 'i686-pc-windows-gnu' && matrix.channel == 'nightly'
51+
- name: download mingw.7z
3652
run: |
3753
# Disable the download progress bar which can cause perf issues
3854
$ProgressPreference = "SilentlyContinue"
39-
Invoke-WebRequest https://ci-mirrors.rust-lang.org/rustc/i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z -OutFile mingw.7z
40-
7z x -y mingw.7z -oC:\msys64 | Out-Null
41-
del mingw.7z
55+
md -Force ${{ matrix.mingw-7z-path }}
56+
Invoke-WebRequest https://ci-mirrors.rust-lang.org/rustc/i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z -OutFile ${{ matrix.mingw-7z-path }}/mingw.7z
57+
if: matrix.target == 'i686-pc-windows-gnu' && matrix.channel == 'nightly' && steps.cache-mingw.outputs.cache-hit != 'true'
58+
shell: powershell
59+
- name: install mingw32
60+
run: |
61+
7z x -y ${{ matrix.mingw-7z-path }}/mingw.7z -oC:\msys64 | Out-Null
4262
echo ::add-path::C:\msys64\mingw32\bin
43-
if: matrix.target == 'i686-pc-windows-gnu'
63+
if: matrix.target == 'i686-pc-windows-gnu' && matrix.channel == 'nightly'
4464
shell: powershell
65+
66+
# Run build
4567
- name: setup
4668
uses: actions-rs/toolchain@v1
4769
with:

0 commit comments

Comments
 (0)