wip2 #60
Workflow file for this run
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 & Test | |
env: | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
on: | |
push: | |
pull_request: | |
jobs: | |
build-and-test: | |
name: Build and test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
zig_version: | |
- latest | |
#- master - not compatible yet | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: mlugg/setup-zig@v1 | |
with: | |
version: ${{ matrix.zig_version }} | |
- name: Install dependencies | |
shell: bash | |
run: | | |
sudo apt-get install libgl-dev libxi-dev \ | |
libx11-dev xserver-xorg-dev xorg-dev | |
# kle tests not triggered from main, | |
# must figure out how to properly zig test | |
- run: | | |
zig build | |
zig build test | |
zig test src/kle.zig | |
zig test src/spsc_queue.zig | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: klawa | |
path: zig-out/bin/klawa | |
retention-days: 2 | |
if-no-files-found: error | |
run-functional-tests: | |
name: Run functional tests | |
needs: | |
- build-and-test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: klawa | |
path: zig-out/bin | |
- name: Install dependencies | |
shell: bash | |
run: | | |
sudo apt-get install ffmpeg xdotool xvfb | |
- name: Install python dependencies | |
shell: bash | |
run: | | |
cd tests | |
python -m venv .env | |
. .env/bin/activate | |
pip install -r dev-requirements.txt | |
- name: Run tests | |
shell: bash | |
run: | | |
chmod +x zig-out/bin/klawa | |
cd tests && . .env/bin/activate && python -m pytest | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: report | |
path: tests/report/ | |
retention-days: 2 | |
if-no-files-found: error | |
deploy-preview: | |
name: Deploy tests results | |
needs: | |
- run-functional-tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: report | |
path: tests | |
- name: Install Vercel CLI | |
run: npm install --global vercel@latest | |
- name: Pull Vercel Environment Information | |
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Build Project Artifacts | |
run: vercel build --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Deploy Project Artifacts to Vercel | |
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} > url.txt | |
- name: Add summary | |
shell: bash | |
run: | | |
echo '### Deployed' >> $GITHUB_STEP_SUMMARY | |
cat url.txt >> $GITHUB_STEP_SUMMARY |