fork/livesplit-one-desktop

git clone https://git.julia.blue/fork/livesplit-one-desktop

Christopher SerrMerge pull request #26 from CryZe/auto-splitting443fc54

master
5.0 KiB188 linesraw
1name: Rust
2
3on:
4  pull_request:
5  push:
6    branches:
7      - 'master'
8    tags:
9      - '*'
10
11env:
12  CARGO_TERM_COLOR: always
13
14jobs:
15  build:
16    runs-on: ${{ matrix.os }}
17    strategy:
18      fail-fast: false
19      matrix:
20        label:
21          # - Windows aarch64
22          # - Windows i686
23          - Windows x86_64
24          # - Linux arm Hardware Float
25          # - Linux armv7 Hardware Float
26          # - Linux aarch64
27          # - Linux i686
28          - Linux x86_64
29          # - macOS aarch64
30          - macOS x86_64
31
32        include:
33          # - label: Windows aarch64
34          #   target: aarch64-pc-windows-msvc
35          #   os: windows-latest
36          #   cross: skip
37          #   install_target: true
38
39          # - label: Windows i686
40          #   target: i686-pc-windows-msvc
41          #   os: windows-latest
42          #   cross: skip
43          #   install_target: true
44          #   bits: 32bit
45
46          - label: Windows x86_64
47            target: x86_64-pc-windows-msvc
48            os: windows-latest
49            cross: skip
50
51          # - label: Linux arm Hardware Float
52          #   target: arm-unknown-linux-gnueabihf
53          #   os: ubuntu-latest
54          #   features: --no-default-features
55          #   bits: 32bit
56
57          # - label: Linux armv7 Hardware Float
58          #   target: armv7-unknown-linux-gnueabihf
59          #   os: ubuntu-latest
60          #   features: --no-default-features
61          #   bits: 32bit
62
63          # - label: Linux aarch64
64          #   target: aarch64-unknown-linux-gnu
65          #   os: ubuntu-latest
66          #   features: --no-default-features
67
68          # - label: Linux i686
69          #   target: i686-unknown-linux-gnu
70          #   os: ubuntu-latest
71          #   features: --no-default-features
72          #   bits: 32bit
73
74          - label: Linux x86_64
75            target: x86_64-unknown-linux-gnu
76            os: ubuntu-latest
77            cross: skip
78
79          # - label: macOS aarch64
80          #   target: aarch64-apple-darwin
81          #   os: macOS-latest
82          #   cross: skip
83          #   install_target: true
84
85          - label: macOS x86_64
86            target: x86_64-apple-darwin
87            os: macOS-latest
88            cross: skip
89
90    steps:
91      - name: Checkout Commit
92        uses: actions/checkout@v2
93
94      - name: Install Rust
95        uses: hecrj/setup-rust-action@v1
96        with:
97          rust-version: ${{ matrix.toolchain || 'stable' }}
98
99      - name: Install Target
100        if: matrix.install_target != ''
101        run: rustup target add ${{ matrix.target }}
102
103      - name: Install cross
104        if: matrix.cross == ''
105        run: sh .github/workflows/install.sh
106        env:
107          OS_NAME: ${{ matrix.os }}
108          TARGET: ${{ matrix.target }}
109
110      - name: Cache
111        uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
112        with:
113          key: ${{ matrix.target }}
114
115      - name: Install cross
116        if: matrix.cross == ''
117        run: sh .github/workflows/install.sh
118        env:
119          OS_NAME: ${{ matrix.os }}
120
121      - name: Install Dependencies
122        if: matrix.os == 'ubuntu-latest'
123        run: |
124          sudo apt-get install libxkbcommon-dev libwayland-cursor0 libwayland-dev
125
126      - name: Build
127        if: matrix.dylib == ''
128        run: sh .github/workflows/build.sh
129        env:
130          TARGET: ${{ matrix.target }}
131          SKIP_CROSS: ${{ matrix.cross }}
132          IS_DEPLOY: ${{ startsWith(github.ref, 'refs/tags/') && (matrix.release_anyway != '' || !(startsWith(matrix.toolchain, 'nightly') || startsWith(matrix.toolchain, 'beta'))) }}
133          FEATURES: ${{ matrix.features }}
134          OS_NAME: ${{ matrix.os }}
135
136      - name: Prepare Release
137        if: startsWith(github.ref, 'refs/tags/') && matrix.release == ''
138        shell: bash
139        run: .github/workflows/before_deploy.sh
140        env:
141          OS_NAME: ${{ matrix.os }}
142          TARGET: ${{ matrix.target }}
143          PLUGIN_BITS: ${{ matrix.bits || '64bit' }}
144
145      - name: Release
146        if: startsWith(github.ref, 'refs/tags/') && matrix.release == ''
147        uses: softprops/action-gh-release@v1
148        with:
149          files: livesplit-one-*.*
150        env:
151          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
152
153  clippy:
154    runs-on: ubuntu-latest
155    steps:
156      - name: Checkout Commit
157        uses: actions/checkout@v2
158
159      - name: Install Rust
160        uses: hecrj/setup-rust-action@v1
161        with:
162          components: clippy
163
164      - name: Cache
165        uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
166        with:
167          key: ${{ matrix.target }}
168
169      - name: Install Dependencies
170        run: |
171          sudo apt-get install libxkbcommon-dev libwayland-cursor0 libwayland-dev
172
173      - name: Run Clippy
174        run: cargo clippy --all-features
175
176  format:
177    runs-on: ubuntu-latest
178    steps:
179      - name: Checkout Commit
180        uses: actions/checkout@v2
181
182      - name: Install Rust
183        uses: hecrj/setup-rust-action@v1
184        with:
185          components: rustfmt
186
187      - name: Run cargo fmt
188        run: cargo fmt -- --check || true