diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29ad32f..2f81ab1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,20 +11,21 @@ jobs: clippy: name: Run linter runs-on: ubuntu-latest + + strategy: + matrix: + rust: ["1.48"] + env: RUSTFLAGS: -D warnings steps: - name: Checkout uses: actions/checkout@v2 - - name: Checkout submodules - shell: bash - run: | - auth_header="$(git config --local --get http.https://github.com/.extraheader)" - git submodule sync --recursive - git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 + with: {submodules: true} - uses: hecrj/setup-rust-action@v1 with: components: clippy + rust-version: ${{ matrix.rust }} - name: Cache cargo directories uses: actions/cache@v2 with: @@ -55,19 +56,19 @@ jobs: rustfmt: name: Check rustfmt runs-on: ubuntu-latest + + strategy: + matrix: + rust: ["1.48"] + steps: - name: Checkout uses: actions/checkout@v2 - # TODO: why not `with: {submodules: true}` - - name: Checkout submodules - shell: bash - run: | - auth_header="$(git config --local --get http.https://github.com/.extraheader)" - git submodule sync --recursive - git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 + with: {submodules: true} - uses: hecrj/setup-rust-action@v1 with: components: rustfmt + rust-version: ${{ matrix.rust }} - run: cargo fmt --all -- --check test: @@ -82,6 +83,7 @@ jobs: rust: - stable - beta + - "1.48" os: - ubuntu-latest - macos-latest diff --git a/xtask/src/submodules.rs b/xtask/src/submodules.rs index 1f369d3..7d9b864 100644 --- a/xtask/src/submodules.rs +++ b/xtask/src/submodules.rs @@ -188,7 +188,11 @@ fn git_submodule_update_init_recursive() -> Result<()> { static NO_PROGRESS_FLAG: AtomicBool = AtomicBool::new(false); fn do_git_smu(with_progress_flag: bool) -> Result<()> { - let flag = with_progress_flag.then(|| "--progress"); + let flag = if with_progress_flag { + Some("--progress") + } else { + None + }; xshell::cmd!("git submodule update --init --recursive {flag...}") .echo_cmd(crate::verbose()) .run()?;