-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRAFT] Introducing new workflow: Building K from source in MacOS #3674
Closed
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
84c7c12
Introducing new workflow
Robertorosmaninho f69bb55
Chaning name of workflow
Robertorosmaninho 43b9590
Setting direnv
Robertorosmaninho a082403
Update test-pr-macos.yml
Robertorosmaninho 4e25ce1
Update test-pr-macos.yml
Robertorosmaninho f592052
Update test-pr-macos.yml
Robertorosmaninho b064818
Update test-pr-macos.yml
Robertorosmaninho 1ddd80e
Update test-pr-macos.yml
Robertorosmaninho 3f0a355
Update test-pr-macos.yml
Robertorosmaninho 49e6fbf
Update test-pr-macos.yml
Robertorosmaninho 64edbb0
Update test-pr-macos.yml
Robertorosmaninho c35c1f5
Update test-pr-macos.yml
Robertorosmaninho File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
name: "Test PR on MacOS" | ||
on: | ||
pull_request: | ||
types: [opened, edited, reopened, synchronize] | ||
branches: | ||
- "develop" | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
version-sync: | ||
name: "Version Sync" | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: "Check out code" | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.JENKINS_GITHUB_PAT }} | ||
# fetch-depth 0 means deep clone the repo | ||
fetch-depth: 0 | ||
- name: "Update Version" | ||
run: | | ||
set -x | ||
git config user.name devops | ||
git config user.email [email protected] | ||
./package/version.sh sub | ||
if git add --update && git commit --message "Set Version: $(cat package/version)"; then | ||
git push origin HEAD:${GITHUB_HEAD_REF} | ||
fi | ||
|
||
nix-maven: | ||
name: "Maven Build" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- runner: macos-13 | ||
os: macos-13 | ||
- runner: MacM1 | ||
os: self-macos-12 | ||
runs-on: ${{ matrix.runner }} | ||
needs: version-sync | ||
steps: | ||
- name: "Check out code, set up Git" | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
- name: "Upgrade bash" | ||
if: ${{ contains(matrix.os, 'macos') }} | ||
run: brew install bash | ||
- name: "Install Dependencies" | ||
run: brew install bison boost cmake flex fmt gcc gmp openjdk jemalloc libyaml llvm@15 make maven mpfr pkg-config python stack zlib z3 | ||
- name: "Install and set up direnv" | ||
run: | | ||
set -euxo pipefail | ||
export PATH="$(brew --prefix bison)/bin:$PATH" | ||
export PATH="$(brew --prefix flex)/bin:$PATH" | ||
export PATH="$(brew --prefix llvm@15)/bin:$PATH" | ||
export PATH="$(brew --prefix openjdk)/bin:$PATH" | ||
echo $(which llvm-config) | ||
export LLVM_CONFIG=$(which llvm-config) | ||
export LLVM_DIR="$(brew --prefix llvm@15)/lib/cmake/" | ||
mvn package -T1C | ||
# brew install direnv | ||
# cp macos-envrc .envrc | ||
# eval "$(direnv hook bash)" | ||
# direnv allow . | ||
- name: "Build K from Source" | ||
run: | | ||
set -euxo pipefail | ||
LLVM_CONFIG=$(which llvm-config) mvn package -T1C | ||
|
||
test-k: | ||
name: "K Tests" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- runner: macos-13 | ||
os: macos-13 | ||
- runner: MacM1 | ||
os: self-macos-12 | ||
runs-on: ${{ matrix.runner }} | ||
needs: version-sync | ||
steps: | ||
- name: "Check out code" | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: "Build and Test K" | ||
run: mvn verify --batch-mode -U | ||
- name: "Check out k-exercises" | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: runtimeverification/k-exercises | ||
token: ${{ secrets.JENKINS_GITHUB_PAT }} | ||
submodules: recursive | ||
path: k-exercises | ||
- name: "Tutorial Integration Tests" | ||
run: | | ||
k-distribution/target/release/k/bin/spawn-kserver kserver.log | ||
cd k-exercises/tutorial && make -j`nproc` --output-sync | ||
cd ../../k-distribution/k-tutorial/1_basic && ./test_kompile.sh' | ||
cd ../2_intermediate && ./test_kompile.sh' | ||
|
||
# performance-tests: | ||
# name: 'Performace Tests' | ||
# runs-on: [self-hosted, linux, performance] | ||
# needs: test-package-ubuntu-jammy | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - name: 'Download K package from the Summary Page' | ||
# uses: actions/download-artifact@v3 | ||
# with: | ||
# name: kframework.deb | ||
# - name: 'Set up Docker Test Image' | ||
# env: | ||
# BASE_OS: ubuntu | ||
# BASE_DISTRO: jammy | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }} | ||
# BENCHER_PROJECT: k-framework | ||
# BENCHER_ADAPTER: json | ||
# run: | | ||
# set -euxo pipefail | ||
# workspace=$(pwd) | ||
# docker run --name k-profiling-tests-${GITHUB_SHA} \ | ||
# --rm -it --detach \ | ||
# -e BENCHER_API_TOKEN=$BENCHER_API_TOKEN \ | ||
# -e BENCHER_PROJECT=$BENCHER_PROJECT \ | ||
# -e BENCHER_ADAPTER=$BENCHER_ADAPTER \ | ||
# -e GITHUB_HEAD_REF=$GITHUB_HEAD_REF \ | ||
# -e GITHUB_BASE_REF=$GITHUB_BASE_REF \ | ||
# -e GITHUB_TOKEN=$GITHUB_TOKEN \ | ||
# -e GITHUB_ACTIONS=true \ | ||
# -e GITHUB_EVENT_NAME=$GITHUB_EVENT_NAME \ | ||
# -e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \ | ||
# -e GITHUB_REF=$GITHUB_REF \ | ||
# --workdir /opt/workspace \ | ||
# -v "${workspace}:/opt/workspace" \ | ||
# ${BASE_OS}:${BASE_DISTRO} | ||
# - name: 'Install K from Package' | ||
# run: | | ||
# set -euxo pipefail | ||
# docker exec -t k-profiling-tests-${GITHUB_SHA} /bin/bash -c './k-distribution/tests/profiling/setup_profiling.sh' | ||
# - name: 'Profiling Performance Tests' | ||
# run: | | ||
# set -euxo pipefail | ||
# docker exec -t k-profiling-tests-${GITHUB_SHA} /bin/bash -c 'cd k-distribution/tests/profiling && make' | ||
# - name: 'Tear down Docker' | ||
# if: always() | ||
# run: | | ||
# docker stop --time=0 k-profiling-tests-${GITHUB_SHA} | ||
# docker container rm --force k-profiling-tests-${GITHUB_SHA} || true |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you're reaching that conclusion, but
direnv
is not something I'd expect to see in CI - it's just a local developer convenience tool.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I don't quite follow what you mean by
Could you please elaborate on that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is here: https://github.com/kframework/homebrew-k/blob/master/Formula/kframework.rb
If you've not seen a Homebrew formula before, it's basically a Ruby DSL that allows you to specify dependencies and build steps for a package. We maintain one for K; if there are macOS-specific issues with the build then it's plausible that the Homebrew code has already dealt with it somehow