|
| 1 | +name: Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + |
| 6 | +jobs: |
| 7 | + test: |
| 8 | + strategy: |
| 9 | + fail-fast: false |
| 10 | + matrix: |
| 11 | + include: |
| 12 | + - { target: x86_64-pc-windows-msvc, os: windows-2019 } |
| 13 | + - { target: x86_64-pc-windows-msvc, os: windows-2022 } |
| 14 | + - { target: x86_64-apple-darwin, os: macos-11 } |
| 15 | + - { target: x86_64-apple-darwin, os: macos-12 } |
| 16 | + - { target: x86_64-unknown-linux-gnu, os: ubuntu-20.04 } |
| 17 | + - { target: x86_64-unknown-linux-gnu, os: ubuntu-22.04 } |
| 18 | + name: test (${{ matrix.target }}) |
| 19 | + runs-on: ${{ matrix.os }} |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v3 |
| 22 | + |
| 23 | + - name: Read ./rust-toolchain |
| 24 | + id: read-rust-toolchain |
| 25 | + run: echo "toolchain=$(cat ./rust-toolchain)" >> "$GITHUB_OUTPUT" |
| 26 | + shell: bash |
| 27 | + |
| 28 | + - name: Set up Rust |
| 29 | + uses: dtolnay/rust-toolchain@master |
| 30 | + with: |
| 31 | + toolchain: ${{ steps.read-rust-toolchain.outputs.toolchain }} |
| 32 | + targets: ${{ matrix.target }} |
| 33 | + |
| 34 | + - name: Test (main) |
| 35 | + run: cargo test --target ${{ matrix.target }} |
| 36 | + |
| 37 | + docker-build: |
| 38 | + runs-on: ubuntu-22.04 |
| 39 | + steps: |
| 40 | + - uses: actions/checkout@v3 |
| 41 | + |
| 42 | + - name: Update ShellCheck |
| 43 | + run: | |
| 44 | + sudo apt-get update |
| 45 | + sudo apt-get install -y shellcheck |
| 46 | + shellcheck -V |
| 47 | +
|
| 48 | + - name: Read ./rust-toolchain |
| 49 | + id: read-rust-toolchain |
| 50 | + run: echo "toolchain=$(cat ./rust-toolchain)" >> "$GITHUB_OUTPUT" |
| 51 | + shell: bash |
| 52 | + |
| 53 | + - name: Set up Rust |
| 54 | + uses: dtolnay/rust-toolchain@master |
| 55 | + with: |
| 56 | + toolchain: ${{ steps.read-rust-toolchain.outputs.toolchain }} |
| 57 | + |
| 58 | + - name: Generate install-command.bash |
| 59 | + run: cargo xtask gen-command > ./install-command.bash |
| 60 | + |
| 61 | + - name: docker-build |
| 62 | + run: docker build . |
0 commit comments