Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.github/workflows: Splitting up into multiple reusable and dependent …
Browse files Browse the repository at this point in the history
…jobs.
ivucica committed May 8, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 1ce26b4 commit 02ed2c3
Showing 3 changed files with 41 additions and 11 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/apt_deps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Intall apt deps

on:
workflow_call:

run-name: Installing Ubuntu dependencies

jobs:
apt_deps:
runs-on: ubuntu-latest

steps:
- name: install deps with prebuilt SDL (no bazel)
run: sudo apt-get update && sudo apt-get install libsdl1.2-dev libsdl-gfx1.2-dev libgmp3-dev autoconf automake libgl1-mesa-dev libglu1-mesa-dev
- name: install deps without prebuilt SDL (bazel)
run: sudo apt-get update && sudo apt-get install autoconf automake libgl1-mesa-dev libglu1-mesa-dev libx11-dev libxext-dev libxrandr-dev libxrender-dev libasound-dev libalsaplayer-dev
17 changes: 17 additions & 0 deletions .github/workflows/checkout.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Initial clone

on:
workflow_call:

run-name: Cloning ${{ github.ref_name }} and submodules

jobs:
initial_clone:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
#- name: Checkout submodules
# uses: textbook/[email protected]
- name: Checkout submodules
run: git submodule init && git submodule update
19 changes: 8 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -6,17 +6,16 @@ on: [push, pull_request]
run-name: Run CI with ${{ github.ref_name }} by @${{ github.actor }}

jobs:
checkout:
uses: ./.github/workflows/checkout.yml
apt_deps:
uses: ./.github/workflows/apt_deps.yml

cpp:
runs-on: ubuntu-latest

needs: [checkout, apt_deps]
steps:
- uses: actions/checkout@v1
#- name: Checkout submodules
# uses: textbook/[email protected]
- name: Checkout submodules
run: git submodule init && git submodule update
- name: install deps
run: sudo apt-get update && sudo apt-get install libsdl1.2-dev libsdl-gfx1.2-dev libgmp3-dev autoconf automake libgl1-mesa-dev libglu1-mesa-dev
- name: install glict
run: cd vendor/github.com/ivucica/glict/glict && ./autogen.sh && ./configure && make && sudo make install
- name: autogen
@@ -33,6 +32,7 @@ jobs:
bazel:
runs-on: ubuntu-latest

needs: [checkout, apt_deps]
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, which is the CWD for
# the rest of the steps
@@ -60,10 +60,6 @@ jobs:
run: echo Stub action merely printing a notice that there was a cache miss
# More useful with e.g. npm.

- name: Checkout submodules
run: git submodule init && git submodule update
- name: install deps
run: sudo apt-get update && sudo apt-get install autoconf automake libgl1-mesa-dev libglu1-mesa-dev libx11-dev libxext-dev libxrandr-dev libxrender-dev libasound-dev libalsaplayer-dev
- name: bazel build
run: bazel build //:yatc
- name: bazel test
@@ -72,6 +68,7 @@ jobs:
bazel-buildbuddy:
runs-on: ubuntu-latest

needs: checkout
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, which is the CWD for
# the rest of the steps

0 comments on commit 02ed2c3

Please sign in to comment.