Skip to content

Improves CI and adds local runner (#27) #124

Improves CI and adds local runner (#27)

Improves CI and adds local runner (#27) #124

Workflow file for this run

name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
permissions:
checks: write
contents: write
pull-requests: write
env:
RUSTFLAGS: "-Dwarnings"
BUILD_ID: ${{ github.job }}-${{ github.run_id }}
# Latest Node.js version: https://nodejs.org/en
NODE_VERSION: 22.5.1
# Latest Rust version: https://www.rust-lang.org/
RUST_VERSION: 1.80.0
jobs:
nodejs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install
run: npm install --omit=dev
working-directory: ./ui
- name: Lint
run: npm run lint
working-directory: ./ui
- name: Test
run: npm run test
working-directory: ./ui
- name: Build
run: npm run build
working-directory: ./ui
rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set Rust version
run: |
if [ "$(rustc --version | awk '{ print $2 }')" != "$RUST_VERSION" ]; then
rustup update "$RUST_VERSION"
rustup default "$RUST_VERSION"
rustup component add clippy
fi
- name: Lint
run: cargo clippy --all-targets --all-features
- name: Test
run: cargo test
ci:
needs:
- nodejs
- rust
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Build CI
run: |
docker \
build \
-t wiki-ci:build-$BUILD_ID \
-f images/build.Dockerfile \
.
docker \
run \
--rm \
-v ${{ github.workspace }}:${{ github.workspace }} \
-w ${{ github.workspace }} \
wiki-ci:build-$BUILD_ID \
sh -c 'cargo build --bin ci'
- name: Run CI
run: ./target/debug/ci -v --github-logger --all
- name: Test Results
uses: dorny/test-reporter@v1
with:
name: Wiki CI Test Results
path: test_results/*.xml
reporter: java-junit
if: always()