Skip to content

Commit

Permalink
init jnv project
Browse files Browse the repository at this point in the history
  • Loading branch information
ynqa committed Mar 19, 2024
0 parents commit 57a8e9d
Show file tree
Hide file tree
Showing 16 changed files with 1,594 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM mcr.microsoft.com/devcontainers/rust:1-1-bullseye

# Clang 15
RUN apt-get update \
&& apt-get install -y \
build-essential \
autoconf \
libtool \
git \
wget \
software-properties-common \
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|apt-key add - \
&& apt-add-repository "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-15 main" \
&& apt-get update \
&& apt-get install -y clang-15 lldb-15 lld-15 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN ln -s /usr/bin/clang-15 /usr/bin/clang \
&& ln -s /usr/bin/clang++-15 /usr/bin/clang++
43 changes: 43 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/rust
{
"name": "Rust",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
// "image": "mcr.microsoft.com/devcontainers/rust:1-1-bullseye",
"build": {
// Path is relative to the devcontainer.json file.
"dockerfile": "Dockerfile"
},

"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer"
]
}
}

// Use 'mounts' to make the cargo cache persistent in a Docker Volume.
// "mounts": [
// {
// "source": "devcontainer-cargo-cache-${devcontainerId}",
// "target": "/usr/local/cargo",
// "type": "volume"
// }
// ]

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "rustc --version",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: ci

on: [push]

jobs:
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install clang package
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
autoconf \
libtool \
git \
wget \
software-properties-common
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-15 main"
sudo apt-get update
sudo apt-get install -y \
clang-15 \
lldb-15 \
lld-15
- name: Set default compiler to clang
run: |
echo "CC=clang-15" >> $GITHUB_ENV
echo "CXX=clang++-15" >> $GITHUB_ENV
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- uses: actions-rs/cargo@v1
with:
command: clippy
- uses: actions-rs/cargo@v1
with:
command: test
args: -- --nocapture --format pretty
- uses: actions-rs/cargo@v1
with:
command: build
args: --examples
- uses: actions-rs/cargo@v1
with:
command: build
args: --bins
Loading

0 comments on commit 57a8e9d

Please sign in to comment.