Skip to content

Merge #973

Merge #973 #2140

Workflow file for this run

name: CI
permissions:
contents: read
on:
pull_request:
push:
branches:
- staging
- trying
schedule:
- cron: '0 1 * * *'
env:
RUSTFLAGS: -Dwarnings
RUST_BACKTRACE: 1
defaults:
run:
shell: bash
jobs:
# Test crates on their minimum Rust versions and nightly Rust.
test:
env:
RUST_VERSION: ${{ matrix.rust }}
RUST_TARGET: ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
include:
- rust: '1.38'
os: ubuntu-latest
- rust: '1.38'
os: windows-latest
- rust: stable
os: ubuntu-latest
- rust: stable
os: windows-latest
- rust: nightly
os: ubuntu-latest
# TODO: https://github.com/crossbeam-rs/crossbeam/pull/518#issuecomment-633342606
# - rust: nightly
# os: macos-latest
- rust: nightly
os: windows-latest
- rust: nightly
os: ubuntu-latest
target: i686-unknown-linux-gnu
- rust: nightly
os: ubuntu-latest
target: aarch64-unknown-linux-gnu
# Test 32-bit target that does not have AtomicU64/AtomicI64.
- rust: nightly
os: ubuntu-latest
target: mips-unknown-linux-gnu
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Rust
# --no-self-update is necessary because the windows environment cannot self-update rustup.exe.
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
- name: Install cross
uses: taiki-e/install-action@cross
if: matrix.target != ''
- name: Test
run: ./ci/test.sh
# Check all feature combinations works properly.
features:
env:
RUST_VERSION: ${{ matrix.rust }}
strategy:
fail-fast: false
matrix:
rust:
- '1.38'
- nightly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Check features
run: ./ci/check-features.sh
# Check for duplicate dependencies.
dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Install cargo-minimal-versions
uses: taiki-e/install-action@cargo-minimal-versions
- name: dependency tree check
run: ./ci/dependencies.sh
# When this job failed, run ci/no_atomic.sh and commit result changes.
codegen:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update nightly && rustup default nightly
- run: ci/no_atomic.sh
- run: git add -N . && git diff --exit-code
if: github.repository_owner != 'crossbeam-rs' || github.event_name != 'schedule'
- id: diff
run: |
git config user.name "Taiki Endo"
git config user.email "te316e89@gmail.com"
git add -N .
if ! git diff --exit-code; then
git add .
git commit -m "Update no_atomic.rs"
echo "::set-output name=success::false"
fi
if: github.repository_owner == 'crossbeam-rs' && github.event_name == 'schedule'
- uses: taiki-e/create-pull-request@v3
with:
title: Update no_atomic.rs
body: |
Auto-generated by [create-pull-request][1]
[Please close and immediately reopen this pull request to run CI.][2]
[1]: https://github.com/peter-evans/create-pull-request
[2]: https://github.com/peter-evans/create-pull-request/blob/HEAD/docs/concepts-guidelines.md#workarounds-to-trigger-further-workflow-runs
branch: update-no-atomic-rs
if: github.repository_owner == 'crossbeam-rs' && github.event_name == 'schedule' && steps.diff.outputs.success == 'false'
# Check formatting.
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update stable
- name: rustfmt
run: ./ci/rustfmt.sh
# This branch no longer actively developed. Most commits to this
# branch are backporting and should not be blocked by clippy.
# # Check clippy.
# clippy:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Install Rust
# run: rustup update stable
# - name: clippy
# run: ./ci/clippy.sh
# Run miri.
miri:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup toolchain install nightly --component miri && rustup default nightly
- name: miri
run: ./ci/miri.sh
# Run sanitizers.
san:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: Run sanitizers
run: ./ci/san.sh
# Run loom tests.
loom:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update stable
- name: loom
run: ./ci/crossbeam-epoch-loom.sh
# Check if the document can be generated without warning.
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: docs
run: ./ci/docs.sh
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install shellcheck
uses: taiki-e/install-action@shellcheck
- run: shellcheck $(git ls-files '*.sh')
# This job doesn't actually test anything, but they're used to tell bors the
# build completed, as there is no practical way to detect when a workflow is
# successful listening to webhooks only.
#
# ALL THE PREVIOUS JOBS NEEDS TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
ci-success:
name: ci
if: github.event_name == 'push' && success()
needs:
- test
- features
- dependencies
- codegen
- rustfmt
# - clippy
- miri
- san
- loom
- docs
- shellcheck
runs-on: ubuntu-latest
steps:
- name: Mark the job as a success
run: exit 0