Merge pull request #393 from smkent/swatch #981
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: Build | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
Build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 💾 Check out repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: 'recursive' | |
- name: 🌿 Fetch base branch | |
run: | | |
git fetch origin "${GITHUB_BASE_REF}" | |
- name: 🪝 Cache pre-commit hooks | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pre-commit | |
key: "pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') | |
}}" | |
- name: 🛠️ Install tools | |
shell: bash | |
run: | | |
sudo apt update | |
sudo apt install -y openscad xvfb pandoc texlive-xetex | |
python3 -m pip install pre-commit scons | |
- name: 🔥 Run static checks | |
run: pre-commit run --all-files | |
- name: 🏗️ Render models | |
run: xvfb-run scons ref="origin/${GITHUB_BASE_REF}" | |
# Only render models for pull requests | |
if: ${{ github.event_name == 'pull_request' }} | |
- name: 📦 Save artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: "Rendered Models" | |
path: | | |
**/build/* | |
!**/build/**/*.deps | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: false |