mirror of
https://git.ahines.net/joeyahines/Albatross.git
synced 2026-05-08 08:02:13 +00:00
Add gitea CI and task
This commit is contained in:
parent
a22c781c52
commit
4135098c3d
42
.drone.yml
42
.drone.yml
@ -1,42 +0,0 @@
|
|||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: compliance
|
|
||||||
type: docker
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- pull_request
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build
|
|
||||||
pull: always
|
|
||||||
image: rust:1.55.0
|
|
||||||
commands:
|
|
||||||
- cargo build --verbose
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: release
|
|
||||||
type: docker
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build
|
|
||||||
pull: always
|
|
||||||
image: rust:1.55.0
|
|
||||||
commands:
|
|
||||||
- cargo build --verbose --release
|
|
||||||
- name: gitea-release
|
|
||||||
pull: always
|
|
||||||
image: jolheiser/drone-gitea-main:latest
|
|
||||||
settings:
|
|
||||||
token:
|
|
||||||
from_secret: gitea_token
|
|
||||||
base: https://git.canopymc.net
|
|
||||||
files:
|
|
||||||
- "target/release/albatross"
|
|
||||||
29
.gitea/workflows/build.yaml
Normal file
29
.gitea/workflows/build.yaml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
name: Build and Test Formaty
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Install Task
|
||||||
|
uses: go-task/setup-task@v2
|
||||||
|
with:
|
||||||
|
repo-token: ${{ secrets.TASK_GITHUB_API_TOKEN }}
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Stable with rustfmt and clippy
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: stable
|
||||||
|
components: rustfmt, clippy
|
||||||
|
- name: Lint Code
|
||||||
|
run: task check
|
||||||
|
- name: Build
|
||||||
|
run: task build
|
||||||
|
- name: Run Unit Tests
|
||||||
|
run: task test
|
||||||
|
- name: Upload Built Binary
|
||||||
|
uses: christopherHX/gitea-upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: formaty
|
||||||
|
path: target/debug/formaty
|
||||||
23
.gitea/workflows/release.yaml
Normal file
23
.gitea/workflows/release.yaml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
name: Build and Release Formaty
|
||||||
|
on: [release]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Install Task
|
||||||
|
uses: go-task/setup-task@v2
|
||||||
|
with:
|
||||||
|
repo-token: ${{ secrets.TASK_GITHUB_API_TOKEN }}
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Stable with rustfmt and clippy
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: stable
|
||||||
|
- name: Build Release
|
||||||
|
run: task build:release
|
||||||
|
- uses: https://gitea.com/actions/gitea-release-action@v1
|
||||||
|
with:
|
||||||
|
files: |-
|
||||||
|
target/release/formaty
|
||||||
38
Taskfile.yaml
Normal file
38
Taskfile.yaml
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
# yaml-language-server: $schema=https://taskfile.dev/schema.json
|
||||||
|
|
||||||
|
version: '3'
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
version:
|
||||||
|
desc: Print out Rust version info
|
||||||
|
cmds:
|
||||||
|
- cargo --version
|
||||||
|
- rustc --version
|
||||||
|
- cargo clippy --version
|
||||||
|
build:
|
||||||
|
desc: Debug build
|
||||||
|
cmds:
|
||||||
|
- cargo build --timings --tests --bins
|
||||||
|
test:
|
||||||
|
desc: Test code
|
||||||
|
deps: [build]
|
||||||
|
cmds:
|
||||||
|
- cargo test --locked
|
||||||
|
build:release:
|
||||||
|
desc: Release build
|
||||||
|
cmds:
|
||||||
|
- cargo build --release --locked --timings
|
||||||
|
fmt:
|
||||||
|
desc: Format Rust code
|
||||||
|
cmds:
|
||||||
|
- cargo fmt
|
||||||
|
check:
|
||||||
|
desc: Lint code with Clippy
|
||||||
|
cmds:
|
||||||
|
- cargo check
|
||||||
|
- cargo fmt --check
|
||||||
|
- cargo clippy
|
||||||
|
clean:
|
||||||
|
desc: Purge Rust build cache
|
||||||
|
cmds:
|
||||||
|
- cargo clean
|
||||||
Loading…
x
Reference in New Issue
Block a user