summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/.github/workflows
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/rustfmt/.github/workflows')
-rw-r--r--src/tools/rustfmt/.github/workflows/integration.yml85
-rw-r--r--src/tools/rustfmt/.github/workflows/linux.yml39
-rw-r--r--src/tools/rustfmt/.github/workflows/mac.yml36
-rw-r--r--src/tools/rustfmt/.github/workflows/rustdoc_check.yml25
-rw-r--r--src/tools/rustfmt/.github/workflows/upload-assets.yml81
-rw-r--r--src/tools/rustfmt/.github/workflows/windows.yml62
6 files changed, 328 insertions, 0 deletions
diff --git a/src/tools/rustfmt/.github/workflows/integration.yml b/src/tools/rustfmt/.github/workflows/integration.yml
new file mode 100644
index 000000000..4d8899b43
--- /dev/null
+++ b/src/tools/rustfmt/.github/workflows/integration.yml
@@ -0,0 +1,85 @@
+name: integration
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+
+jobs:
+ integration-tests:
+ runs-on: ubuntu-latest
+ name: ${{ matrix.integration }}
+ strategy:
+ # https://help.github.com/en/actions/getting-started-with-github-actions/about-github-actions#usage-limits
+ # There's a limit of 60 concurrent jobs across all repos in the rust-lang organization.
+ # In order to prevent overusing too much of that 60 limit, we throttle the
+ # number of rustfmt jobs that will run concurrently.
+ max-parallel: 4
+ fail-fast: false
+ matrix:
+ integration: [
+ bitflags,
+ error-chain,
+ log,
+ mdbook,
+ packed_simd,
+ rust-semverver,
+ tempdir,
+ futures-rs,
+ rust-clippy,
+ failure,
+ ]
+ include:
+ # Allowed Failures
+ # Actions doesn't yet support explicitly marking matrix legs as allowed failures
+ # https://github.community/t5/GitHub-Actions/continue-on-error-allow-failure-UI-indication/td-p/37033
+ # https://github.community/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
+ #
+ # Failing due to breaking changes in rustfmt 2.0 where empty
+ # match blocks have trailing commas removed
+ # https://github.com/rust-lang/rustfmt/pull/4226
+ - integration: chalk
+ allow-failure: true
+ - integration: crater
+ allow-failure: true
+ - integration: glob
+ allow-failure: true
+ - integration: stdsimd
+ allow-failure: true
+ # 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@v3
+
+ # Run build
+ - name: install rustup
+ run: |
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
+ sh rustup-init.sh -y --default-toolchain none
+
+ - name: run integration tests
+ env:
+ INTEGRATION: ${{ matrix.integration }}
+ TARGET: x86_64-unknown-linux-gnu
+ run: ./ci/integration.sh
+ continue-on-error: ${{ matrix.allow-failure == true }}
diff --git a/src/tools/rustfmt/.github/workflows/linux.yml b/src/tools/rustfmt/.github/workflows/linux.yml
new file mode 100644
index 000000000..bce9b0c8d
--- /dev/null
+++ b/src/tools/rustfmt/.github/workflows/linux.yml
@@ -0,0 +1,39 @@
+name: linux
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ name: (${{ matrix.target }}, ${{ matrix.cfg_release_channel }})
+ env:
+ CFG_RELEASE_CHANNEL: ${{ matrix.cfg_release_channel }}
+ strategy:
+ # https://help.github.com/en/actions/getting-started-with-github-actions/about-github-actions#usage-limits
+ # There's a limit of 60 concurrent jobs across all repos in the rust-lang organization.
+ # In order to prevent overusing too much of that 60 limit, we throttle the
+ # number of rustfmt jobs that will run concurrently.
+ max-parallel: 1
+ fail-fast: false
+ matrix:
+ target: [
+ x86_64-unknown-linux-gnu,
+ ]
+ cfg_release_channel: [nightly, stable]
+
+ steps:
+ - name: checkout
+ uses: actions/checkout@v3
+
+ # Run build
+ - name: install rustup
+ run: |
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
+ sh rustup-init.sh -y --default-toolchain none
+ rustup target add ${{ matrix.target }}
+
+ - name: Build and Test
+ run: ./ci/build_and_test.sh
diff --git a/src/tools/rustfmt/.github/workflows/mac.yml b/src/tools/rustfmt/.github/workflows/mac.yml
new file mode 100644
index 000000000..89a980c42
--- /dev/null
+++ b/src/tools/rustfmt/.github/workflows/mac.yml
@@ -0,0 +1,36 @@
+name: mac
+on:
+ push:
+ branches:
+ - master
+ 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.cfg_release_channel }})
+ env:
+ CFG_RELEASE_CHANNEL: ${{ matrix.cfg_release_channel }}
+ strategy:
+ fail-fast: false
+ matrix:
+ target: [
+ x86_64-apple-darwin,
+ ]
+ cfg_release_channel: [nightly, stable]
+
+ steps:
+ - name: checkout
+ uses: actions/checkout@v3
+
+ # Run build
+ - name: install rustup
+ run: |
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
+ sh rustup-init.sh -y --default-toolchain none
+ rustup target add ${{ matrix.target }}
+
+ - name: Build and Test
+ run: ./ci/build_and_test.sh
diff --git a/src/tools/rustfmt/.github/workflows/rustdoc_check.yml b/src/tools/rustfmt/.github/workflows/rustdoc_check.yml
new file mode 100644
index 000000000..cd0c32189
--- /dev/null
+++ b/src/tools/rustfmt/.github/workflows/rustdoc_check.yml
@@ -0,0 +1,25 @@
+name: rustdoc check
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+
+jobs:
+ rustdoc_check:
+ runs-on: ubuntu-latest
+ name: rustdoc check
+ steps:
+ - name: checkout
+ uses: actions/checkout@v3
+
+ - name: install rustup
+ run: |
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
+ sh rustup-init.sh -y --default-toolchain none
+ rustup target add x86_64-unknown-linux-gnu
+
+ - name: document rustfmt
+ env:
+ RUSTDOCFLAGS: --document-private-items --enable-index-page --show-type-layout --generate-link-to-definition -Zunstable-options -Dwarnings
+ run: cargo doc -Zskip-rustdoc-fingerprint --no-deps -p rustfmt-nightly -p rustfmt-config_proc_macro
diff --git a/src/tools/rustfmt/.github/workflows/upload-assets.yml b/src/tools/rustfmt/.github/workflows/upload-assets.yml
new file mode 100644
index 000000000..25699234a
--- /dev/null
+++ b/src/tools/rustfmt/.github/workflows/upload-assets.yml
@@ -0,0 +1,81 @@
+name: upload
+
+on:
+ push:
+ release:
+ types: [created]
+ workflow_dispatch:
+
+jobs:
+ build-release:
+ name: build-release
+ strategy:
+ matrix:
+ build: [linux-x86_64, macos-x86_64, windows-x86_64-gnu, windows-x86_64-msvc]
+ include:
+ - build: linux-x86_64
+ os: ubuntu-latest
+ rust: nightly
+ target: x86_64-unknown-linux-gnu
+ - build: macos-x86_64
+ os: macos-latest
+ rust: nightly
+ target: x86_64-apple-darwin
+ - build: windows-x86_64-gnu
+ os: windows-latest
+ rust: nightly-x86_64-gnu
+ target: x86_64-pc-windows-gnu
+ - build: windows-x86_64-msvc
+ os: windows-latest
+ rust: nightly-x86_64-msvc
+ target: x86_64-pc-windows-msvc
+ runs-on: ${{ matrix.os }}
+ steps:
+ - uses: actions/checkout@v3
+
+ # Run build
+ - name: install rustup
+ run: |
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
+ sh rustup-init.sh -y --default-toolchain none
+ rustup target add ${{ matrix.target }}
+
+ - name: Add mingw64 to path for x86_64-gnu
+ run: echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH
+ if: matrix.rust == 'nightly-x86_64-gnu'
+ shell: bash
+
+ - name: Build release binaries
+ uses: actions-rs/cargo@v1
+ with:
+ command: build
+ args: --release
+
+ - name: Build archive
+ shell: bash
+ run: |
+ staging="rustfmt_${{ matrix.build }}_${{ github.event.release.tag_name }}"
+ mkdir -p "$staging"
+
+ cp {README.md,Configurations.md,CHANGELOG.md,LICENSE-MIT,LICENSE-APACHE} "$staging/"
+
+ if [ "${{ matrix.os }}" = "windows-latest" ]; then
+ cp target/release/{rustfmt.exe,cargo-fmt.exe,rustfmt-format-diff.exe,git-rustfmt.exe} "$staging/"
+ 7z a "$staging.zip" "$staging"
+ echo "ASSET=$staging.zip" >> $GITHUB_ENV
+ else
+ cp target/release/{rustfmt,cargo-fmt,rustfmt-format-diff,git-rustfmt} "$staging/"
+ tar czf "$staging.tar.gz" "$staging"
+ echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
+ fi
+
+ - name: Upload Release Asset
+ if: github.event_name == 'release'
+ uses: actions/upload-release-asset@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ github.event.release.upload_url }}
+ asset_path: ${{ env.ASSET }}
+ asset_name: ${{ env.ASSET }}
+ asset_content_type: application/octet-stream
diff --git a/src/tools/rustfmt/.github/workflows/windows.yml b/src/tools/rustfmt/.github/workflows/windows.yml
new file mode 100644
index 000000000..ec37c714b
--- /dev/null
+++ b/src/tools/rustfmt/.github/workflows/windows.yml
@@ -0,0 +1,62 @@
+name: windows
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+
+jobs:
+ test:
+ runs-on: windows-latest
+ name: (${{ matrix.target }}, ${{ matrix.cfg_release_channel }})
+ env:
+ CFG_RELEASE_CHANNEL: ${{ matrix.cfg_release_channel }}
+ strategy:
+ # https://help.github.com/en/actions/getting-started-with-github-actions/about-github-actions#usage-limits
+ # There's a limit of 60 concurrent jobs across all repos in the rust-lang organization.
+ # In order to prevent overusing too much of that 60 limit, we throttle the
+ # number of rustfmt jobs that will run concurrently.
+ max-parallel: 2
+ fail-fast: false
+ matrix:
+ target: [
+ i686-pc-windows-gnu,
+ i686-pc-windows-msvc,
+ x86_64-pc-windows-gnu,
+ x86_64-pc-windows-msvc,
+ ]
+ cfg_release_channel: [nightly, stable]
+
+ steps:
+ # The Windows runners have autocrlf enabled by default
+ # which causes failures for some of rustfmt's line-ending sensitive tests
+ - name: disable git eol translation
+ run: git config --global core.autocrlf false
+ - name: checkout
+ uses: actions/checkout@v3
+
+ # Run build
+ - name: Install Rustup using win.rustup.rs
+ run: |
+ # Disable the download progress bar which can cause perf issues
+ $ProgressPreference = "SilentlyContinue"
+ Invoke-WebRequest https://win.rustup.rs/ -OutFile rustup-init.exe
+ .\rustup-init.exe -y --default-host=x86_64-pc-windows-msvc --default-toolchain=none
+ del rustup-init.exe
+ rustup target add ${{ matrix.target }}
+ shell: powershell
+
+ - name: Add mingw32 to path for i686-gnu
+ run: |
+ echo "C:\msys64\mingw32\bin" >> $GITHUB_PATH
+ if: matrix.target == 'i686-pc-windows-gnu' && matrix.channel == 'nightly'
+ shell: bash
+
+ - name: Add mingw64 to path for x86_64-gnu
+ run: echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH
+ if: matrix.target == 'x86_64-pc-windows-gnu' && matrix.channel == 'nightly'
+ shell: bash
+
+ - name: Build and Test
+ shell: cmd
+ run: ci\build_and_test.bat