diff options
Diffstat (limited to '.github/workflows/ci.yml')
-rw-r--r-- | .github/workflows/ci.yml | 85 |
1 files changed, 54 insertions, 31 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b82cd99..93feb348 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,9 @@ on: pull_request: schedule: [cron: "40 1 * * *"] +permissions: + contents: read + jobs: test: name: ${{matrix.name || format('Rust {0}', matrix.rust)}} @@ -16,25 +19,23 @@ jobs: - rust: nightly - rust: beta - rust: stable - - rust: 1.48.0 + - rust: 1.60.0 - name: macOS rust: nightly os: macos - - name: Windows (gnu) - rust: nightly-x86_64-pc-windows-gnu - os: windows - name: Windows (msvc) rust: nightly-x86_64-pc-windows-msvc os: windows flags: /EHsc env: CXXFLAGS: ${{matrix.flags}} - RUSTFLAGS: --cfg deny_warnings + RUSTFLAGS: --cfg deny_warnings -Dwarnings + timeout-minutes: 45 steps: - name: Enable symlinks (windows) if: matrix.os == 'windows' run: git config --global core.symlinks true - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@master with: toolchain: ${{matrix.rust}} @@ -45,51 +46,61 @@ jobs: # build. The extra coverage is not particularly valuable and we can # still ensure the test is kept passing on the basis of the scheduled # builds. - if: matrix.os && github.event_name != 'schedule' - run: echo "RUSTFLAGS=--cfg skip_ui_tests $RUSTFLAGS" >> $GITHUB_ENV + run: | + echo RUSTFLAGS=$RUSTFLAGS >> $GITHUB_ENV + echo exclude=--exclude cxx-test-suite >> $GITHUB_OUTPUT + env: + RUSTFLAGS: ${{env.RUSTFLAGS}} ${{matrix.os && github.event_name != 'schedule' && '--cfg skip_ui_tests' || ''}} + id: testsuite shell: bash - run: cargo run --manifest-path demo/Cargo.toml - - run: cargo test --workspace --exclude cxx-test-suite + - run: cargo test --workspace ${{steps.testsuite.outputs.exclude}} + - run: cargo check --no-default-features --features alloc + env: + RUSTFLAGS: --cfg compile_error_if_std ${{env.RUSTFLAGS}} + - run: cargo check --no-default-features + env: + RUSTFLAGS: --cfg compile_error_if_alloc --cfg cxx_experimental_no_alloc ${{env.RUSTFLAGS}} buck: name: Buck runs-on: ubuntu-latest if: github.event_name != 'pull_request' + timeout-minutes: 45 steps: - - uses: actions/checkout@v2 - - uses: dtolnay/rust-toolchain@stable - - uses: actions/setup-java@v1 + - uses: actions/checkout@v3 with: - java-version: 11 - java-package: jre - - name: Install Buck - run: | - mkdir bin - wget -q -O bin/buck https://jitpack.io/com/github/facebook/buck/a5f0342ae3/buck-a5f0342ae3-java11.pex # dev branch from 2020.10.11 - chmod +x bin/buck - echo bin >> $GITHUB_PATH + submodules: true + - uses: dtolnay/rust-toolchain@stable + - uses: dtolnay/install@reindeer + - uses: dtolnay/install@buck2 - name: Install lld run: sudo apt-get install lld - - name: Vendor dependencies - run: | - cp third-party/Cargo.lock . - cargo vendor --versioned-dirs --locked third-party/vendor - - run: buck build :cxx#check --verbose=0 - - run: buck run demo --verbose=0 - - run: buck test ... --verbose=0 + - run: cargo vendor --versioned-dirs --locked + working-directory: third-party + - run: reindeer vendor + working-directory: third-party + - name: Check reindeer-generated BUCK file up to date + run: git diff --exit-code + - run: buck2 run demo + - run: buck2 build ... + - run: buck2 run tests:test bazel: name: Bazel runs-on: ubuntu-latest if: github.event_name != 'pull_request' + timeout-minutes: 45 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install Bazel run: | - wget -q -O install.sh https://github.com/bazelbuild/bazel/releases/download/4.0.0/bazel-4.0.0-installer-linux-x86_64.sh + wget -q -O install.sh https://github.com/bazelbuild/bazel/releases/download/5.1.1/bazel-5.1.1-installer-linux-x86_64.sh chmod +x install.sh ./install.sh --user echo $HOME/bin >> $GITHUB_PATH + - name: Install lld + run: sudo apt-get install lld - run: bazel run demo --verbose_failures --noshow_progress - run: bazel test ... --verbose_failures --noshow_progress @@ -97,8 +108,9 @@ jobs: name: Clippy runs-on: ubuntu-latest if: github.event_name != 'pull_request' + timeout-minutes: 45 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@clippy - run: cargo clippy --workspace --tests -- -Dclippy::all @@ -106,9 +118,20 @@ jobs: name: Clang Tidy runs-on: ubuntu-latest if: github.event_name != 'pull_request' + timeout-minutes: 45 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install clang-tidy run: sudo apt-get install clang-tidy-11 - name: Run clang-tidy run: clang-tidy-11 src/cxx.cc --warnings-as-errors=* + + outdated: + name: Outdated + runs-on: ubuntu-latest + if: github.event_name != 'pull_request' + timeout-minutes: 45 + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/install@cargo-outdated + - run: cargo outdated --workspace --exit-code 1 |