2022-04-18 03:15:23 +08:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
schedule: [cron: "40 1 * * *"]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
install:
|
2024-01-11 10:20:44 +08:00
|
|
|
name: Rust ${{matrix.rust || '(toolchain file)'}} ${{matrix.os}}
|
2023-02-14 06:21:02 +08:00
|
|
|
runs-on: ${{matrix.os}}
|
2022-04-18 03:15:23 +08:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2022-07-22 05:26:47 +08:00
|
|
|
rust: [
|
|
|
|
# Test with toolchain file override
|
2023-11-01 17:44:05 +08:00
|
|
|
"",
|
2023-02-14 04:00:11 +08:00
|
|
|
# Test that the sparse registry check works.
|
|
|
|
# 1.66 and 1.67 don't support stable sparse registry.
|
|
|
|
"1.66",
|
2022-07-22 05:26:47 +08:00
|
|
|
"nightly",
|
|
|
|
"beta",
|
|
|
|
"stable",
|
|
|
|
]
|
2023-02-14 06:21:02 +08:00
|
|
|
os: [
|
|
|
|
"ubuntu-latest",
|
|
|
|
"windows-latest",
|
|
|
|
"macos-latest",
|
|
|
|
]
|
2022-04-18 03:15:23 +08:00
|
|
|
steps:
|
2023-10-01 15:14:31 +08:00
|
|
|
- uses: actions/checkout@v4
|
2022-07-22 05:26:47 +08:00
|
|
|
# Test toolchain file support
|
|
|
|
- name: Write rust-toolchain.toml
|
|
|
|
run: |
|
|
|
|
cat <<EOF >>rust-toolchain.toml
|
|
|
|
[toolchain]
|
2023-02-14 04:02:26 +08:00
|
|
|
channel = "nightly-2022-09-10"
|
2022-07-22 05:26:47 +08:00
|
|
|
components = [ "rustfmt", "rustc-dev" ]
|
2023-02-16 02:06:41 +08:00
|
|
|
targets = [ "wasm32-unknown-unknown", "thumbv7m-none-eabi" ]
|
2022-07-22 05:26:47 +08:00
|
|
|
profile = "minimal"
|
|
|
|
EOF
|
|
|
|
shell: bash
|
2023-11-01 17:44:05 +08:00
|
|
|
if: matrix.rust == ''
|
2022-07-22 05:26:47 +08:00
|
|
|
|
2022-04-18 03:15:23 +08:00
|
|
|
- uses: ./
|
2023-11-01 17:44:05 +08:00
|
|
|
name: Run actions-rust-lang/setup-rust-toolchain ${{matrix.rust || 'on toolchain file'}}
|
2022-04-18 03:15:23 +08:00
|
|
|
id: toolchain
|
|
|
|
with:
|
|
|
|
toolchain: ${{matrix.rust}}
|
2023-05-20 22:29:33 +08:00
|
|
|
components: clippy
|
2022-04-18 03:15:23 +08:00
|
|
|
- name: Check ${{'${{steps.toolchain.outputs.rustc-version}}'}}
|
|
|
|
run: echo '${{steps.toolchain.outputs.rustc-version}}'
|
|
|
|
- name: Check ${{'${{steps.toolchain.outputs.cargo-version}}'}}
|
|
|
|
run: echo '${{steps.toolchain.outputs.cargo-version}}'
|
|
|
|
- name: Check ${{'${{steps.toolchain.outputs.rustup-version}}'}}
|
|
|
|
run: echo '${{steps.toolchain.outputs.rustup-version}}'
|
|
|
|
- run: rustc --version && cargo --version
|
|
|
|
shell: bash
|
2023-02-14 04:00:11 +08:00
|
|
|
|
|
|
|
# Test with creating a small project
|
2023-02-14 04:02:26 +08:00
|
|
|
- run: cargo init . --bin --name ci
|
2023-02-14 04:00:11 +08:00
|
|
|
# Add tiny empty crate.
|
|
|
|
# This checks that registry access works.
|
|
|
|
- run: cargo add serde_as
|
2023-05-20 22:29:33 +08:00
|
|
|
- run: cargo clippy
|