Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
allanger committed Jan 17, 2023
0 parents commit c409ffb
Show file tree
Hide file tree
Showing 13 changed files with 1,718 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
61 changes: 61 additions & 0 deletions .github/workflows/build-version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
name: "Version build"

on:
push:
tags:
- "v*.*.*"

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
steps:
- name: Checkout
uses: actions/checkout@v2

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}

- uses: actions-rs/cargo@v1
with:
command: build
args: --release --all-features --target=${{ matrix.target }}

- name: Archive build artifacts
uses: actions/upload-artifact@v2
with:
name: build-${{matrix.target}}
path: ${{ github.workspace }}/target/${{ matrix.target }}/release/clin

release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Download artifact
uses: actions/download-artifact@v2

- name: Set version variable
run: echo "CLIN_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV

- name: Rename release to avoid name conflict
run: ./scripts/rename_releases.sh

- name: Release
uses: softprops/action-gh-release@v1
with:
files: release/*
53 changes: 53 additions & 0 deletions .github/workflows/container-stable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: "Stable container"

on:
push:
branches:
- main
paths:
- "src/**"

jobs:
containerization:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set action link variable
run: echo "LINK=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV

- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}

- name: Build
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/allanger/${{ env.GITHUB_REPOSITORY }}:stable
ghcr.io/allanger/${{ env.GITHUB_REPOSITORY }}:latest
labels: |
action_id=${{ github.action }}
action_link=${{ env.LINK }}
actor=${{ github.actor }}
sha=${{ github.sha }}
ref=${{ github.ref }}
53 changes: 53 additions & 0 deletions .github/workflows/container-version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: "Version container"

on:
push:
tags:
- "v*.*.*"

jobs:
containerization:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set version variable
run: echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV

- name: Set action link variable
run: echo "LINK=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV

- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}

- name: Build
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/allanger/${{ env.GITHUB_REPOSITORY }}:${{ env.TAG }}
labels: |
action_id=${{ github.action }}
action_link=${{ env.LINK }}
actor=${{ github.actor }}
sha=${{ github.sha }}
ref=${{ github.ref }}
57 changes: 57 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
name: "Tests"

on:
pull_request:
branches:
- main
paths:
- "src/**"

jobs:
cargo_udeps:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- uses: actions-rs/toolchain@v1
with:
toolchain: nightly

- name: Install cargo-udeps
run: cargo install cargo-udeps --locked

- name: Check dependencies
run: cargo +nightly udeps

cargo_test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- uses: actions-rs/toolchain@v1
with:
toolchain: stable

- uses: actions-rs/cargo@v1
with:
command: build
args: --release --all-features
- run: cargo test
cargo_clippy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- uses: actions-rs/toolchain@v1
with:
toolchain: stable

- uses: actions-rs/cargo@v1
with:
command: build
args: --release --all-features
- run: cargo clippy
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
Loading

0 comments on commit c409ffb

Please sign in to comment.