fork/livesplit-one-desktop

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

Christopher SerrRelease v0.0.15c981a5

v0.0.1
5.2 KiB194 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: Select XCode to use
116        if: matrix.target == 'aarch64-apple-darwin'
117        run: |
118          sudo xcode-select -s "/Applications/Xcode_12.3.app"
119          sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*
120
121      - name: Install cross
122        if: matrix.cross == ''
123        run: sh .github/workflows/install.sh
124        env:
125          OS_NAME: ${{ matrix.os }}
126
127      - name: Install Dependencies
128        if: matrix.os == 'ubuntu-latest'
129        run: |
130          sudo apt-get install libxkbcommon-dev libwayland-cursor0 libwayland-dev
131
132      - name: Build
133        if: matrix.dylib == ''
134        run: sh .github/workflows/build.sh
135        env:
136          TARGET: ${{ matrix.target }}
137          SKIP_CROSS: ${{ matrix.cross }}
138          IS_DEPLOY: ${{ startsWith(github.ref, 'refs/tags/') && (matrix.release_anyway != '' || !(startsWith(matrix.toolchain, 'nightly') || startsWith(matrix.toolchain, 'beta'))) }}
139          FEATURES: ${{ matrix.features }}
140          OS_NAME: ${{ matrix.os }}
141
142      - name: Prepare Release
143        if: startsWith(github.ref, 'refs/tags/') && matrix.release == ''
144        shell: bash
145        run: .github/workflows/before_deploy.sh
146        env:
147          OS_NAME: ${{ matrix.os }}
148          TARGET: ${{ matrix.target }}
149          PLUGIN_BITS: ${{ matrix.bits || '64bit' }}
150
151      - name: Release
152        if: startsWith(github.ref, 'refs/tags/') && matrix.release == ''
153        uses: softprops/action-gh-release@v1
154        with:
155          files: livesplit-one-*.*
156        env:
157          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
158
159  clippy:
160    runs-on: ubuntu-latest
161    steps:
162      - name: Checkout Commit
163        uses: actions/checkout@v2
164
165      - name: Install Rust
166        uses: hecrj/setup-rust-action@v1
167        with:
168          components: clippy
169
170      - name: Cache
171        uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
172        with:
173          key: ${{ matrix.target }}
174
175      - name: Install Dependencies
176        run: |
177          sudo apt-get install libxkbcommon-dev libwayland-cursor0 libwayland-dev
178
179      - name: Run Clippy
180        run: cargo clippy --all-features
181
182  format:
183    runs-on: ubuntu-latest
184    steps:
185      - name: Checkout Commit
186        uses: actions/checkout@v2
187
188      - name: Install Rust
189        uses: hecrj/setup-rust-action@v1
190        with:
191          components: rustfmt
192
193      - name: Run cargo fmt
194        run: cargo fmt -- --check || true