Skip to content

more GitHub Actions enablement #3982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[alias]
t = "test-all"
ta = "test-all"
test-all = "test --manifest-path rustfmt-core/Cargo.toml"

test-bin = "test --manifest-path rustfmt-core/rustfmt-bin/Cargo.toml"
tb = "test-bin"

test-config = "test --manifest-path rustfmt-core/rustfmt-config/Cargo.toml"
tc = "test-config"

test-emitter = "test --manifest-path rustfmt-core/rustfmt-emitter/Cargo.toml"
te = "test-emitter"

test-lib = "test --manifest-path rustfmt-core/rustfmt-lib/Cargo.toml"
tl = "test-lib"

i = "install --path . --force --locked"
71 changes: 71 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: integration
on: [push, pull_request]

jobs:
integration-tests:
runs-on: ubuntu-latest
name: ${{ matrix.integration }}
strategy:
fail-fast: false
matrix:
integration: [
bitflags,
chalk,
crater,
error-chain,
glob,
log,
mdbook,
packed_simd,
rust-semverver,
stdsimd,
tempdir,
futures-rs,
rust-clippy,
failure,
]
include:
# Allowed Failures
# Actions doesn't yet support explicitly marking matrix legs as allowed failures
# https://i.8713187.xyzmunity/t5/GitHub-Actions/continue-on-error-allow-failure-UI-indication/td-p/37033
# https://i.8713187.xyzmunity/t5/GitHub-Actions/Why-a-matrix-step-will-be-canceled-if-another-one-failed/td-p/30920
# Instead, leverage `continue-on-error`
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error
#
# Using old rustfmt configuration option
- integration: rand
allow-failure: true
# Keep this as an allowed failure as it's fragile to breaking changes of rustc.
- integration: rust-clippy
allow-failure: true
# Using old rustfmt configuration option
- integration: packed_simd
allow-failure: true
# calebcartwright (2019-12-24)
# Keeping this as an allowed failure since it was flagged as such in the TravisCI config, even though
# it appears to have been passing for quite some time.
# Original comment was: temporal build failure due to breaking changes in the nightly compiler
- integration: rust-semverver
allow-failure: true
# Can be moved back to include section after https://github.com/rust-lang-nursery/failure/pull/298 is merged
- integration: failure
allow-failure: true

steps:
- name: checkout
uses: actions/checkout@v2

# Run build
- name: setup
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-x86_64-unknown-linux-gnu
target: x86_64-unknown-linux-gnu
override: true
profile: minimal
default: true
- name: run integration tests
env:
INTEGRATION: ${{ matrix.integration }}
run: ./ci/integration.sh
continue-on-error: ${{ matrix.allow-failure == true }}
45 changes: 45 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: linux
on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
name: (${{ matrix.target }}, ${{ matrix.channel }}, ${{ matrix.cfg-release-channel }})
strategy:
fail-fast: false
matrix:
target: [
x86_64-unknown-linux-gnu,
]
channel: [ nightly ]
cfg-release-channel: [
beta,
nightly,
]

env:
CFG_RELEASE_CHANNEL: ${{ matrix.cfg-release-channel }}

steps:
- name: checkout
uses: actions/checkout@v2

# Run build
- name: setup
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.channel }}-${{ matrix.target }}
target: ${{ matrix.target }}
override: true
profile: minimal
default: true
- name: build
run: |
rustc -Vv
cargo -V
cargo build --manifest-path rustfmt-core/Cargo.toml --workspace

- name: test
run: cargo test-all
- name: test ignored
run: cargo test-all -- --ignored
40 changes: 40 additions & 0 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: mac
on: [push, pull_request]

jobs:
test:
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources
# macOS Catalina 10.15
runs-on: macos-latest
name: (${{ matrix.target }}, ${{ matrix.channel }})
strategy:
fail-fast: false
matrix:
target: [
x86_64-apple-darwin,
]
channel: [ nightly ]

steps:
- name: checkout
uses: actions/checkout@v2

# Run build
- name: setup
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.channel }}-${{ matrix.target }}
target: ${{ matrix.target }}
override: true
profile: minimal
default: true
- name: build
run: |
rustc -Vv
cargo -V
cargo build --manifest-path rustfmt-core/Cargo.toml --workspace

- name: test
run: cargo test-all
- name: test ignored
run: cargo test-all -- --ignored
48 changes: 33 additions & 15 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on: [push, pull_request]
jobs:
test:
runs-on: windows-latest
name: (${{ matrix.target }}, ${{ matrix.channel }})
strategy:
fail-fast: false
matrix:
Expand All @@ -14,6 +15,10 @@ jobs:
x86_64-pc-windows-msvc,
]
channel: [ nightly ]
include:
- channel: nightly
target: i686-pc-windows-gnu
mingw-7z-path: mingw

steps:
# The Windows runners have autocrlf enabled by default
Expand All @@ -22,6 +27,7 @@ jobs:
run: git config --global core.autocrlf false
- name: checkout
uses: actions/checkout@v2

# The Windows runners do not (yet) have a proper msys/mingw environment
# pre-configured like AppVeyor does, though they will likely be added in the future.
# https://github.com/actions/virtual-environments/issues/30
Expand All @@ -32,16 +38,33 @@ jobs:
# package and numworks/setup-msys2 action.
# https://github.com/rust-lang/rust/blob/master/src/ci/scripts/install-mingw.sh#L59
# https://github.com/rust-lang/rustup/blob/master/appveyor.yml
- name: install mingw32
#
# Use GitHub Actions cache support to avoid downloading the .7z file every time
# to be cognizant of the AWS egress cost impacts
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy
- name: cache mingw.7z
id: cache-mingw
with:
path: ${{ matrix.mingw-7z-path }}
key: ${{ matrix.channel }}-${{ matrix.target }}-mingw
uses: actions/cache@v1
if: matrix.target == 'i686-pc-windows-gnu' && matrix.channel == 'nightly'
- name: download mingw.7z
run: |
# Disable the download progress bar which can cause perf issues
$ProgressPreference = "SilentlyContinue"
Invoke-WebRequest https://ci-mirrors.rust-lang.org/rustc/i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z -OutFile mingw.7z
7z x -y mingw.7z -oC:\msys64 | Out-Null
del mingw.7z
md -Force ${{ matrix.mingw-7z-path }}
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
if: matrix.target == 'i686-pc-windows-gnu' && matrix.channel == 'nightly' && steps.cache-mingw.outputs.cache-hit != 'true'
shell: powershell
- name: install mingw32
run: |
7z x -y ${{ matrix.mingw-7z-path }}/mingw.7z -oC:\msys64 | Out-Null
echo ::add-path::C:\msys64\mingw32\bin
if: matrix.target == 'i686-pc-windows-gnu'
if: matrix.target == 'i686-pc-windows-gnu' && matrix.channel == 'nightly'
shell: powershell

# Run build
- name: setup
uses: actions-rs/toolchain@v1
with:
Expand All @@ -54,17 +77,12 @@ jobs:
run: |
rustc -Vv
cargo -V
cargo build
cargo build --manifest-path rustfmt-core/Cargo.toml --workspace
shell: cmd

- name: test
run: cargo test
shell: cmd
- name: 'test ignored'
run: cargo test -- --ignored
shell: cmd
- name: 'test rustfmt-core'
run: cargo test --manifest-path rustfmt-core/Cargo.toml
run: cargo test-all
shell: cmd
- name: 'test rustfmt-core ignored'
run: cargo test --manifest-path rustfmt-core/Cargo.toml -- --ignored
- name: test ignored
run: cargo test-all -- --ignored
shell: cmd