diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..33240ce --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,65 @@ +name: Build +on: + push: + tags: + - '*' + +jobs: + publish: + name: Building ${{ matrix.build_target }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + build_target: [linux, macos, windows] + include: + - build_target: linux + os: ubuntu-latest + - build_target: macos + os: macos-latest + - build_target: windows + os: windows-latest + + steps: + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + target: ${{ matrix.target }} + profile: minimal + - name: Install Linux dependencies + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get -qq update + sudo apt-get install -y libxkbcommon-dev lld + - uses: actions/checkout@v2 + - name: Cargo build (WGPU feature) + uses: actions-rs/cargo@v1 + with: + command: build + args: --release + - name: Renaming + if: matrix.os == 'windows-latest' + run: mv target/release/uad_gui.exe target/release/uad_gui-${{ matrix.build_target }}.exe + - name: Renaming + if: matrix.os != 'windows-latest' + run: mv target/release/uad_gui target/release/uad_gui-${{ matrix.build_target }} + - name: Cargo build (Glow feature) + uses: actions-rs/cargo@v1 + with: + command: build + args: --release --features glow + - name: Renaming + if: matrix.os == 'windows-latest' + run: mv target/release/uad_gui.exe target/release/uad_gui-${{ matrix.build_target }}-opengl.exe + - name: Renaming + if: matrix.os != 'windows-latest' + run: mv target/release/uad_gui target/release/uad_gui-${{ matrix.build_target }}-opengl + - name: Create pre-release + uses: softprops/action-gh-release@v1 + with: + body_path: ${{ github.workspace }}/CHANGELOG.md + files: target/release/uad_gui-* + prerelease: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1beb1a1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,107 @@ +name: Continuous Integration +on: + push: + paths: + - '**.rs' + - 'Cargo.lock' + - 'Cargo.toml' + pull_request: + paths: + - '**.rs' + - 'Cargo.lock' + - 'Cargo.toml' + +jobs: + check: + name: Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: | + sudo apt -qq update + sudo apt install -y lld + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-check-${{ hashFiles('**/Cargo.lock') }} + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + - uses: actions-rs/cargo@v1 + with: + command: check + args: --all-features + + test: + name: Test Suite + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: | + sudo apt -qq update + sudo apt install -y libxkbcommon-dev lld + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-test-${{ hashFiles('**/Cargo.lock') }} + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + - uses: actions-rs/cargo@v1 + with: + command: test + + fmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + - run: rustup component add rustfmt + - uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: | + sudo apt -qq update + sudo apt install -y lld + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-clippy-${{ hashFiles('**/Cargo.lock') }} + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + - run: rustup component add clippy + - uses: actions-rs/cargo@v1 + with: + command: clippy + args: --all -- -D warnings \ No newline at end of file