From d24be4eee6a7d3218c86a6be45222a5c71950c70 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Tue, 10 Dec 2024 00:35:45 +0100 Subject: [PATCH] .gitea/build: init --- .gitea/workflows/build.yml | 73 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .gitea/workflows/build.yml diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..70ae14b --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,73 @@ +name: "Build" +on: + push: + branches: + - main + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Build or restore dependency cache + uses: Swatinem/rust-cache@v2 + + - name: Build + run: cargo build --all-features --verbose --release + + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + components: rustfmt, clippy + + - name: Build or restore dependency cache + uses: Swatinem/rust-cache@v2 + + - name: Check code format + run: cargo fmt -- --check + + - name: Check clippy + run: cargo clippy --all-features -- --deny warnings + + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Build or restore dependency cache + uses: Swatinem/rust-cache@v2 + + - name: Build docs + run: cargo doc --all-features --document-private-items --release + + - name: Transfer files + uses: https://git.pvv.ntnu.no/Projects/rsync-action@main + with: + source: target/doc/ + target: ${{ gitea.ref_name }}/docs/ + username: gitea-web + ssh-key: ${{ secrets.WEB_SYNC_SSH_KEY }} + host: bekkalokk.pvv.ntnu.no + known-hosts: "bekkalokk.pvv.ntnu.no ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEI6VSaDrMG8+flg4/AeHlAFIen8RUzWh6URQKqFegSx" +