mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-03 10:14:06 +02:00
nix ci
This commit is contained in:
parent
6659d673ea
commit
da6a2d62bd
5 changed files with 123 additions and 84 deletions
66
.github/workflows/ci.yml
vendored
Normal file
66
.github/workflows/ci.yml
vendored
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
check:
|
||||
name: Check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: cachix/install-nix-action@v20
|
||||
- uses: icewind1991/attic-action@v1
|
||||
with:
|
||||
name: ci
|
||||
instance: https://cache.icewind.me
|
||||
authToken: '${{ secrets.ATTIC_TOKEN }}'
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- uses: lriesebos/nix-develop-command@6f5f4830884d1957767e920c51d6118c9b0ac828
|
||||
with:
|
||||
command: "cargo check"
|
||||
|
||||
test:
|
||||
name: Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: cachix/install-nix-action@v20
|
||||
- uses: icewind1991/attic-action@v1
|
||||
with:
|
||||
name: ci
|
||||
instance: https://cache.icewind.me
|
||||
authToken: '${{ secrets.ATTIC_TOKEN }}'
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- uses: lriesebos/nix-develop-command@6f5f4830884d1957767e920c51d6118c9b0ac828
|
||||
with:
|
||||
command: "cargo test"
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target:
|
||||
- x86_64-unknown-linux-gnu
|
||||
- x86_64-unknown-linux-musl
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: cachix/install-nix-action@v20
|
||||
- uses: icewind1991/attic-action@v1
|
||||
with:
|
||||
name: ci
|
||||
instance: https://cache.icewind.me
|
||||
authToken: '${{ secrets.ATTIC_TOKEN }}'
|
||||
- run: nix build .#${{ matrix.target }}
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: parser-${{ matrix.target }}
|
||||
path: result/bin/parse_demo
|
||||
32
.github/workflows/release.yml
vendored
32
.github/workflows/release.yml
vendored
|
|
@ -5,28 +5,22 @@ on:
|
|||
types: [created]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Static Linux Binaries
|
||||
release-binaries:
|
||||
name: Build release binaries
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: build dependencies
|
||||
run: |
|
||||
sudo apt-get install musl-tools
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
- uses: actions/checkout@v3
|
||||
- uses: cachix/install-nix-action@v20
|
||||
- uses: icewind1991/attic-action@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
target: x86_64-unknown-linux-musl
|
||||
- uses: Swatinem/rust-cache@v1
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --release --target x86_64-unknown-linux-musl
|
||||
- uses: svenstaro/upload-release-action@v2
|
||||
name: ci
|
||||
instance: https://cache.icewind.me
|
||||
authToken: '${{ secrets.ATTIC_TOKEN }}'
|
||||
- run: nix build .#x86_64-unknown-linux-musl
|
||||
- name: Upload binary to release
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: target/x86_64-unknown-linux-musl/release/parse_demo
|
||||
file: result/bin/parse_demo
|
||||
asset_name: parse_demo
|
||||
tag: ${{ github.ref }}
|
||||
|
||||
tag: ${{ github.ref }}
|
||||
58
.github/workflows/rust.yml
vendored
58
.github/workflows/rust.yml
vendored
|
|
@ -1,58 +0,0 @@
|
|||
on: [ push, pull_request ]
|
||||
|
||||
name: CI
|
||||
|
||||
jobs:
|
||||
check:
|
||||
name: Check
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
- uses: Swatinem/rust-cache@v1
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: check
|
||||
|
||||
|
||||
test:
|
||||
name: Test
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
- uses: Swatinem/rust-cache@v1
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
|
||||
build:
|
||||
name: Build Binaries
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- name: musl-tools
|
||||
run: |
|
||||
sudo apt-get install musl-tools
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
target: x86_64-unknown-linux-musl
|
||||
- uses: Swatinem/rust-cache@v1
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --release --target x86_64-unknown-linux-musl
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: parse_demo
|
||||
path: target/x86_64-unknown-linux-musl/release/parse_demo
|
||||
Loading…
Add table
Add a link
Reference in a new issue