Skip to content

Commit

Permalink
update CI so it can also optionally push ot a new branch
Browse files Browse the repository at this point in the history
  • Loading branch information
justinlaughlin committed Aug 23, 2024
1 parent 4152561 commit 4838b00
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ on:
# We use 3.1.51 because later versions give compiler errors
# (possibly related to https://github.com/emscripten-core/emscripten/issues/21128)
default: '3.1.51'
make-branch:
type: boolean
default: false

pull_request:

jobs:
Expand All @@ -26,27 +30,29 @@ jobs:
mfem-ref: ${{ github.event_name == 'pull_request' && 'master' || inputs.mfem-ref }}
glvis-ref: ${{ github.event_name == 'pull_request' && 'master' || inputs.glvis-ref }}
emscripten-version: ${{ github.event_name == 'pull_request' && '3.1.51' || inputs.emscripten-version }}
make-branch: ${{ github.event_name == 'workflow_dispatch' && inputs.make-branch }}

name: >-
build glvis-js |
mfem=${{ github.event_name == 'pull_request' && 'master' || inputs.mfem-ref }} |
glvis=${{ github.event_name == 'pull_request' && 'master' || inputs.glvis-ref }} |
mfem=${{ github.event_name == 'pull_request' && 'master' || inputs.mfem-ref }} |
glvis=${{ github.event_name == 'pull_request' && 'master' || inputs.glvis-ref }} |
emcc=${{ github.event_name == 'pull_request' && '3.1.51' || inputs.emscripten-version }}
steps:
# ---------------------------------------------------------------------------------
# Install glvis-js and dependencies
# ---------------------------------------------------------------------------------
- name: Install glvis dependencies
run: |
sudo apt-get install libfontconfig1-dev libfreetype-dev libsdl2-dev \
libglew-dev libglm-dev libpng-dev git-lfs
- name: Checkout glvis-js
uses: actions/checkout@v4
with:
submodules: recursive
path: glvis-js

- name: Install glvis dependencies
run: |
sudo apt-get install libfontconfig1-dev libfreetype-dev libsdl2-dev \
libglew-dev libglm-dev libpng-dev
lfs: true

- name: Checkout emscripten
uses: actions/checkout@v4
Expand Down Expand Up @@ -77,15 +83,15 @@ jobs:
path: glvis

- name: Install glvis-js (also installs mfem + glvis)
run: |
run: |
cd glvis-js
make install -j 4
# ---------------------------------------------------------------------------------
# Generate an artifact
# ---------------------------------------------------------------------------------
- name: Print artifact info
run: |
run: |
cat glvis-js/src/versions.js
sha256sum glvis-js/src/*
Expand All @@ -95,3 +101,14 @@ jobs:
name: glvis-js
path: glvis-js/src
retention-days: 1

- name: Push changes to a new branch
if: env.make-branch
run: |
cd glvis-js
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git switch -c "ci-build-${{ github.run_id }}"
git add .
git commit -m "Updating glvis-js build"
git push

0 comments on commit 4838b00

Please sign in to comment.