This repository has been archived on 2024-08-06. You can view files and clone it, but cannot push or open issues or pull requests.
jnc-calibre-web-importer/.forgejo/workflows/pull-requests.yml

56 lines
1.4 KiB
YAML
Raw Normal View History

2024-01-13 15:13:10 +00:00
name: 'Build binary file and bundle packages'
author: 'Neshura'
on:
pull_request:
branches:
- main
jobs:
test:
runs-on: docker
container: forgejo.neshweb.net/ci-docker-images/rust-node:latest
steps:
2024-01-13 15:24:48 +00:00
- name: Add Clippy
2024-01-13 15:13:10 +00:00
run: rustup component add clippy
2024-01-13 15:24:48 +00:00
- name: Checking Out Repository Code
2024-01-13 15:13:10 +00:00
uses: https://code.forgejo.org/actions/checkout@v3
2024-01-13 15:24:48 +00:00
- name: Set Up Cargo Cache
2024-01-13 15:13:10 +00:00
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
2024-01-13 15:24:48 +00:00
- name: Run Clippy
2024-01-13 15:13:10 +00:00
run: cargo clippy
build:
needs: test
if: success()
runs-on: docker
container: forgejo.neshweb.net/ci-docker-images/rust-node:latest
steps:
2024-01-13 15:24:48 +00:00
- name: Checking Out Repository Code
2024-01-13 15:13:10 +00:00
uses: https://code.forgejo.org/actions/checkout@v3
2024-01-13 15:24:48 +00:00
- name: Prepare build environment
2024-01-13 15:13:10 +00:00
run: mkdir dist
2024-01-13 15:24:48 +00:00
- name: Compiling To Linux Target
2024-01-13 15:13:10 +00:00
run: |
cargo build -r
mv target/release/${{ github.event.repository.name }} dist/${{ github.event.repository.name }}-linux-amd64
2024-01-13 15:24:48 +00:00
- name: Uploading Build Artifact
2024-01-13 15:13:10 +00:00
uses: actions/upload-artifact@v3
with:
name: release_blobs
path: dist
if-no-files-found: error