Skip to content

Commit 5f8dbb9

Browse files
committed
init
0 parents  commit 5f8dbb9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+7548
-0
lines changed

.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[build]
2+
rustflags = ["--cfg", "unsound_local_offset"]

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target/

.github/workflows/ci.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- "**.md"
7+
- "**.png"
8+
pull_request:
9+
paths-ignore:
10+
- "**.md"
11+
- "**.png"
12+
13+
env:
14+
RUST_TOOLCHAIN: nightly
15+
TOOLCHAIN_PROFILE: minimal
16+
17+
jobs:
18+
lints:
19+
name: Run cargo fmt and cargo clippy
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout sources
23+
uses: actions/checkout@v2
24+
- name: Install toolchain
25+
uses: actions-rs/toolchain@v1
26+
with:
27+
profile: ${{ env.TOOLCHAIN_PROFILE }}
28+
toolchain: ${{ env.RUST_TOOLCHAIN }}
29+
override: true
30+
components: rustfmt, clippy
31+
- name: Cache
32+
uses: Swatinem/rust-cache@v1
33+
- name: Run cargo fmt
34+
uses: actions-rs/cargo@v1
35+
with:
36+
command: fmt
37+
args: --all -- --check
38+
- name: Run cargo check with no default features
39+
uses: actions-rs/cargo@v1
40+
with:
41+
command: check
42+
args: --no-default-features
43+
- name: Run cargo check with all features
44+
uses: actions-rs/cargo@v1
45+
with:
46+
command: check
47+
args: --all-features
48+
- name: Run cargo clippy
49+
uses: actions-rs/cargo@v1
50+
with:
51+
command: clippy
52+
args: -- -D warnings
53+
test:
54+
name: Run cargo test
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: Checkout sources
58+
uses: actions/checkout@v2
59+
- name: Install toolchain
60+
uses: actions-rs/toolchain@v1
61+
with:
62+
profile: ${{ env.TOOLCHAIN_PROFILE }}
63+
toolchain: ${{ env.RUST_TOOLCHAIN }}
64+
override: true
65+
- name: Cache
66+
uses: Swatinem/rust-cache@v1
67+
- name: Run cargo test --no-run
68+
uses: actions-rs/cargo@v1
69+
with:
70+
command: test
71+
args: --all-features --no-run
72+
- name: Run cargo test
73+
run: sudo bash -c "ulimit -Sl 512 && ulimit -Hl 512 && sudo -u runner RUSTUP_TOOLCHAIN=nightly /home/runner/.cargo/bin/cargo test --all-features"

.github/workflows/docker-build.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: docker build and push
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
env:
9+
CARGO_NET_GIT_FETCH_WITH_CLI: true
10+
11+
jobs:
12+
build:
13+
name: 'Build'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
- name: Extract tag
19+
id: prep
20+
if: "startsWith(github.ref, 'refs/tags/v')"
21+
run: |
22+
echo ::set-output name=tags::ghcr.io/qini7-sese/ehbot:${GITHUB_REF#refs/tags/v}
23+
- name: Set up QEMU
24+
uses: docker/setup-qemu-action@v1
25+
with:
26+
platforms: all
27+
- name: Set up Docker Buildx
28+
id: buildx
29+
uses: docker/setup-buildx-action@v1
30+
- name: Login to GHCR
31+
uses: docker/login-action@v1
32+
with:
33+
registry: ghcr.io
34+
username: qini7-sese
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
- name: Generate App Version
37+
run: echo VERSIONED_TAG=`git describe --tags --always` >> $GITHUB_ENV
38+
- name: Build docker image
39+
uses: docker/build-push-action@v2
40+
with:
41+
push: true
42+
platforms: linux/amd64,linux/arm64
43+
tags: |
44+
ghcr.io/qini7-sese/ehbot:latest
45+
ghcr.io/qini7-sese/ehbot:${{ env.VERSIONED_TAG }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/target
2+
config.yaml

0 commit comments

Comments
 (0)