Fixed issue where group assignment would be lost on check PATCH. #174
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous master build | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
clippy: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: target/ | |
key: cargo-clippy-cache-${{ matrix.arch.target }} | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly-2023-11-29 | |
override: true | |
components: clippy | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
test: | |
strategy: | |
matrix: | |
arch: | |
- { | |
name: "x86_64", | |
os: "ubuntu-20.04", | |
target: "x86_64-unknown-linux-gnu", | |
cross: false, | |
} | |
runs-on: ${{ matrix.arch.os }} | |
services: | |
mysql: | |
image: mysql:5.7 | |
env: | |
MYSQL_ROOT_PASSWORD: ${{ secrets.MYSQL_ROOT_PASSWORD }} | |
ports: | |
- 3306:3306 | |
steps: | |
- name: Install dependencies | |
run: sudo apt install -y libcap-dev libjq-dev libonig-dev | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: target/ | |
key: cargo-test-cache-${{ matrix.arch.target }} | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly-2023-11-29 | |
override: true | |
- name: Test suite | |
run: | | |
mkdir dist/ | |
sudo capsh --caps='cap_net_raw+eip cap_setpcap,cap_setuid,cap_setgid+ep' --keep=1 --user=runner --addamb=cap_net_raw -- -c "PATH=$PATH HOME=/home/runner JQ_LIB_DIR=/usr/lib/x86_64-linux-gnu DSN=mysql://root:${{ secrets.MYSQL_ROOT_PASSWORD }}@127.0.0.1/information_schema?ssl-mode=DISABLED cargo test --all-features" | |
build: | |
strategy: | |
matrix: | |
arch: | |
- { | |
name: "x86_64", | |
os: "ubuntu-20.04", | |
target: "x86_64-unknown-linux-gnu", | |
cross: false, | |
} | |
python: ["3.8", "3.9", "3.10"] | |
runs-on: ${{ matrix.arch.os }} | |
steps: | |
- name: Install dependencies | |
run: sudo apt install -y libcap-dev libjq-dev libonig-dev | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
target/ | |
assets/node_modules/ | |
key: cargo-build-cache-${{ matrix.arch.target }} | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "14.x" | |
registry-url: <registry url> | |
- run: | | |
yarn --cwd assets | |
yarn --cwd assets build | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly-2023-11-29 | |
override: true | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python }} | |
- run: | | |
which python | |
python --version | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --all-features --target=${{ matrix.arch.target }} | |
use-cross: ${{ matrix.arch.cross }} | |
env: | |
JQ_LIB_DIR: /usr/lib/x86_64-linux-gnu | |
- name: Rename artifact | |
run: | | |
mv target/${{ matrix.arch.target }}/release/defcon target/${{ matrix.arch.target }}/release/defcon-tip-${{ matrix.arch.name }}-py${{ matrix.python }} | |
mv target/${{ matrix.arch.target }}/release/defcon-runner target/${{ matrix.arch.target }}/release/defcon-runner-tip-${{ matrix.arch.name }}-py${{ matrix.python }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: defcon-tip-${{ matrix.arch.name }} | |
path: | | |
target/${{ matrix.arch.target }}/release/defcon-tip-${{ matrix.arch.name }}-py${{ matrix.python }} | |
target/${{ matrix.arch.target }}/release/defcon-runner-tip-${{ matrix.arch.name }}-py${{ matrix.python }} | |
doc: | |
runs-on: ubuntu-20.04 | |
needs: [clippy, test, build] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install mdbook | |
uses: peaceiris/actions-mdbook@v1 | |
with: | |
mdbook-version: "0.4.6" | |
- name: Build user manual | |
run: mdbook build docs/ | |
- name: Build API documentation | |
uses: seeebiii/redoc-cli-github-action@v10 | |
with: | |
args: bundle -o docs/book/api.html docs/api/openapi.yml | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs/book/ | |
package: | |
runs-on: ubuntu-20.04 | |
needs: [clippy, test, build] | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
path: target/out | |
- name: Create release | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
automatic_release_tag: tip | |
title: Development build | |
prerelease: true | |
files: target/out/*/* |