Skip to content

Commit

Permalink
Optimize CI speed (#644)
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechBarczynski authored Jul 23, 2024
1 parent a8b8f9a commit f49cd16
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 27 deletions.
28 changes: 1 addition & 27 deletions .github/workflows/check.yml → .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build, lint and test
name: lint
on:
push:
branches: [master]
Expand Down Expand Up @@ -29,11 +29,6 @@ jobs:
with:
components: rustfmt, clippy

- name: 🔬 Install nextest
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest

- name: 🛠 Setup Node.JS
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -63,34 +58,13 @@ jobs:
- name: 📎 Run clippy
run: cargo clippy --workspace --all-targets --all-features -- -D clippy::todo -D warnings

- name: 🛠 Cargo build
run: |
cargo build --features decklink
cargo build --no-default-features
- name: 📄 Generate JSON schema
working-directory: ./generate
run: |
cargo run --bin generate_from_types -- --check
- name: 🧪 Run tests
run: |
cargo clean
cargo nextest run --workspace --profile ci
- name: 🖋️ Run website lint + typecheck + build
working-directory: ./docs
run: |
npm ci
npm run typecheck && npm run lint --max-warnings=0 && npm run build
- name: 📦 Upload failed snapshot test artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: failed_snapshot_tests
path: failed_snapshot_tests
retention-days: 2

- name: 📚 Run doctests
run: cargo test --workspace --doc
71 changes: 71 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: build and test
on:
push:
branches: [master]
pull_request:
types: [opened, synchronize]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
check:
runs-on: ubuntu-24.04
steps:
- name: 🛠 Install system dependencies
run: |
set -e
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
sudo apt-get update -y -qq
sudo apt-get install -y mesa-vulkan-drivers libegl1-mesa-dev libgl1-mesa-dri libxcb-xfixes0-dev ffmpeg libavcodec-dev libavformat-dev libavfilter-dev libavdevice-dev ttf-mscorefonts-installer libopus-dev
fc-cache -f
- name: 🔧 Install the rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: 🔬 Install nextest
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest

- name: 📥 Checkout repo
uses: actions/checkout@v4

- name: 🧩 Git submodules update
run: |
cat > .gitmodules << EOF
[submodule "snapshot_tests/snapshots"]
path = snapshot_tests/snapshots
url = https://github.com/membraneframework-labs/video_compositor_snapshot_tests.git
EOF
git submodule update --init
- name: 📁 Rust cache
uses: Swatinem/rust-cache@v2

- name: 🪢 Generate Chromium Embedded Framework bindings
run: cargo build --package compositor_chromium

- name: 🛠 Cargo build
run: |
cargo build --features decklink
cargo build --no-default-features
- name: 🧪 Run tests
run: |
cargo nextest run --workspace --profile ci
- name: 📦 Upload failed snapshot test artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: failed_snapshot_tests
path: failed_snapshot_tests
retention-days: 2

- name: 📚 Run doctests
run: cargo test --workspace --doc

0 comments on commit f49cd16

Please sign in to comment.