Skip to content

Commit

Permalink
Merge branch 'dev' into show-hidden-steps
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrus- authored Feb 27, 2024
2 parents e27a46c + 2fae93a commit de4c015
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 8 deletions.
44 changes: 36 additions & 8 deletions .github/workflows/deploy_branches.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# General notes on github actions: Note that both the working directory
# and environment variables generally are not shared between steps.
name: Deploy Hazel
name: Build and Deploy Hazel
on: [push]
jobs:
Deploy:
Expand All @@ -10,39 +10,67 @@ jobs:
# and uncomment them to open an ssh connection at that point:
#- name: Debugging with ssh
# uses: lhotari/action-upterm@v1
- name: Checkout the hazel repo on the current branch # STEP 1
- name: Checkout the hazel repo on the current branch
uses: actions/checkout@v2
with:
path: source
- name: Add the name of the current branch to the environment as BRANCH_NAME
uses: nelonoel/[email protected]
- name: Retrieve the build environment if cached # STEP 2
- name: Retrieve the build environment if cached
id: opam-cache
uses: actions/cache@v2
with:
path: '/home/runner/.opam/'
key: ${{ runner.os }}-modules-${{ hashFiles('./source/opam.export') }}
- name: Install dependencies and build hazel # STEP 3
- name: Set-up OCaml
run: |
sudo apt --assume-yes install curl m4 opam
export OPAMYES=1
opam init --compiler=ocaml-base-compiler.5.0.0
- name: Install dependencies
run: |
eval $(opam env)
export OPAMYES=1
make deps
working-directory: ./source
- name: Build Hazel
run: |
eval $(opam env)
make release
working-directory: ./source
- name: Checkout the website build artifacts repo # STEP 4
- name: Run Tests
id: test
continue-on-error: true
run: |
eval $(opam env)
make test > test_output
if [ $? -eq 0 ]; then
echo "::set-output name=tests_passed::true"
else
echo "::set-output name=tests_passed::false"
fi
working-directory: ./source
- uses: LouisBrunner/[email protected]
if: always()
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Test Results
conclusion: ${{ steps.test.outputs.tests_passed == 'true' && 'success' || 'failure' }}
output_text_description_file: ./source/test_output
output: |
{"summary":"${{ steps.test.outputs.tests_passed == 'true' && 'Tests Passed' || 'Tests Failed' }}"}
- name: Checkout the website build artifacts repo
uses: actions/checkout@v2
with:
repository: hazelgrove/build
token: ${{ secrets.ACCESS_TOKEN }}
path: server
- name: Clear any old build of this branch # STEP 5
- name: Clear any old build of this branch
run: if [ -d "${BRANCH_NAME}" ] ; then rm -rf "${BRANCH_NAME}" ; fi
working-directory: ./server
- name: Copy in the newly built source # STEP 6
- name: Copy in the newly built source
run: mkdir "./server/${BRANCH_NAME}" && cp -r "./source/_build/default/src/haz3lweb/www"/* "./server/${BRANCH_NAME}"
- name : Commit to the website aka deploy # STEP 7
- name : Commit to the website aka deploy
run: |
git config user.name github-deploy-action
git config user.email [email protected]
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ TEST_DIR="$(shell pwd)/_build/default/src/test"
HTML_DIR="$(shell pwd)/_build/default/src/haz3lweb/www"
SERVER="http://0.0.0.0:8000/"

.PHONY: all deps change-deps setup-instructor setup-student dev dev-helper dev-student fmt watch watch-release release release-student echo-html-dir serve serve2 repl test clean

all: dev

deps:
Expand Down

0 comments on commit de4c015

Please sign in to comment.