|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + |
| 6 | +jobs: |
| 7 | + actionlint: |
| 8 | + runs-on: ubuntu-22.04 |
| 9 | + steps: |
| 10 | + - uses: actions/checkout@v3 |
| 11 | + |
| 12 | + - name: Update ShellCheck |
| 13 | + run: | |
| 14 | + sudo apt-get update |
| 15 | + sudo apt-get install -y shellcheck |
| 16 | + shellcheck -V |
| 17 | +
|
| 18 | + - name: actionlint |
| 19 | + run: | |
| 20 | + bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) |
| 21 | + ./actionlint -color |
| 22 | +
|
| 23 | + typos: |
| 24 | + runs-on: ubuntu-22.04 |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v3 |
| 27 | + |
| 28 | + - uses: crate-ci/typos@master |
| 29 | + |
| 30 | + rustfmt: |
| 31 | + runs-on: ubuntu-22.04 |
| 32 | + steps: |
| 33 | + - uses: actions/checkout@v3 |
| 34 | + |
| 35 | + - name: Read ./rust-toolchain |
| 36 | + id: read-rust-toolchain |
| 37 | + run: echo "toolchain=$(cat ./rust-toolchain)" >> "$GITHUB_OUTPUT" |
| 38 | + shell: bash |
| 39 | + |
| 40 | + - name: Set up Rust |
| 41 | + uses: dtolnay/rust-toolchain@master |
| 42 | + with: |
| 43 | + toolchain: ${{ steps.read-rust-toolchain.outputs.toolchain }} |
| 44 | + components: rustfmt |
| 45 | + |
| 46 | + - name: Rustfmt (judge) |
| 47 | + run: cargo fmt --all -- --check |
| 48 | + |
| 49 | + - name: Rustfmt (xtask) |
| 50 | + run: cargo fmt --all --manifest-path ./xtask/Cargo.toml -- --check |
| 51 | + |
| 52 | + clippy: |
| 53 | + runs-on: ubuntu-22.04 |
| 54 | + steps: |
| 55 | + - uses: actions/checkout@v3 |
| 56 | + |
| 57 | + - name: Read ./rust-toolchain |
| 58 | + id: read-rust-toolchain |
| 59 | + run: echo "toolchain=$(cat ./rust-toolchain)" >> "$GITHUB_OUTPUT" |
| 60 | + shell: bash |
| 61 | + |
| 62 | + - name: Set up Rust |
| 63 | + uses: dtolnay/rust-toolchain@master |
| 64 | + with: |
| 65 | + toolchain: ${{ steps.read-rust-toolchain.outputs.toolchain }} |
| 66 | + components: clippy |
| 67 | + |
| 68 | + - name: Clippy (xtask) |
| 69 | + run: cargo clippy --manifest-path ./xtask/Cargo.toml |
| 70 | + |
| 71 | + cargo-deny: |
| 72 | + runs-on: ubuntu-22.04 |
| 73 | + steps: |
| 74 | + - uses: actions/checkout@v3 |
| 75 | + |
| 76 | + - name: Read ./rust-toolchain |
| 77 | + id: read-rust-toolchain |
| 78 | + run: echo "toolchain=$(cat ./rust-toolchain)" >> "$GITHUB_OUTPUT" |
| 79 | + shell: bash |
| 80 | + |
| 81 | + - name: Set up Rust |
| 82 | + uses: dtolnay/rust-toolchain@master |
| 83 | + with: |
| 84 | + toolchain: ${{ steps.read-rust-toolchain.outputs.toolchain }} |
| 85 | + |
| 86 | + - name: Install cargo-binstall |
| 87 | + uses: taiki-e/install-action@cargo-binstall |
| 88 | + |
| 89 | + - name: Install cargo-deny |
| 90 | + run: cargo binstall cargo-deny@^0.13 --no-confirm --log-level debug |
| 91 | + |
| 92 | + - name: cargo-deny (judge) |
| 93 | + run: cargo deny check |
| 94 | + |
| 95 | + build: |
| 96 | + runs-on: ubuntu-22.04 |
| 97 | + steps: |
| 98 | + - uses: actions/checkout@v3 |
| 99 | + |
| 100 | + - name: Update ShellCheck |
| 101 | + run: | |
| 102 | + sudo apt-get update |
| 103 | + sudo apt-get install -y shellcheck |
| 104 | + shellcheck -V |
| 105 | +
|
| 106 | + - name: Read ./rust-toolchain |
| 107 | + id: read-rust-toolchain |
| 108 | + run: echo "toolchain=$(cat ./rust-toolchain)" >> "$GITHUB_OUTPUT" |
| 109 | + shell: bash |
| 110 | + |
| 111 | + - name: Set up Rust |
| 112 | + uses: dtolnay/rust-toolchain@master |
| 113 | + with: |
| 114 | + toolchain: ${{ steps.read-rust-toolchain.outputs.toolchain }} |
| 115 | + |
| 116 | + - name: Generate install-command.bash |
| 117 | + run: cargo xtask gen-command > ./install-command.bash |
| 118 | + |
| 119 | + - name: docker-build |
| 120 | + run: docker build . |
0 commit comments