Skip to content

Commit

Permalink
that's one nasty merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ozgurakgun committed Feb 26, 2024
2 parents 20d3c9e + 2b9618f commit 2dfdcd8
Show file tree
Hide file tree
Showing 10,373 changed files with 741,654 additions and 463,259 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
Empty file removed .MINIONSOLS_1557920204186_7093
Empty file.
2 changes: 0 additions & 2 deletions .MINIONSTATS_1557920204186_7093

This file was deleted.

75 changes: 75 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Building on all platforms

on:
workflow_dispatch: # can be triggered manually
push:
branches:
- main # run for the main branch
paths:
- conjure-cp.cabal
- Makefile
- src/**
- etc/build/**
- .github/workflows/build.yml
pull_request: # and for PRs
paths:
- conjure-cp.cabal
- Makefile
- src/**
- etc/build/**
- .github/workflows/build.yml
# other branches that want testing must create a PR

jobs:

Job:

strategy:
matrix:
GHC_VERSION: ["9.0", "9.2", "9.4"]
os: [ubuntu-latest, macos-latest]

runs-on: ${{ matrix.os }}

steps:

- uses: actions/checkout@v3
name: Checkout repository

- name: Stack version
shell: bash
run: GHC_VERSION=${{ matrix.GHC_VERSION }} make stack.yaml

- uses: actions/cache@v3
name: Cache stack
with:
path: |
~/.stack
.stack-work
key: stack-${{ runner.os }}-ghc${{ matrix.GHC_VERSION }}-${{ github.event.repository.updated_at }}
restore-keys: stack-${{ runner.os }}-ghc${{ matrix.GHC_VERSION }}

- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ runner.os }}

- name: Setting PATH
shell: bash
run: echo "${HOME}/.local/bin" >> ${GITHUB_PATH}

- name: Install Conjure
shell: bash
run: BIN_DIR=${HOME}/.local/bin GHC_VERSION=${{ matrix.GHC_VERSION }} BUILD_TESTS=true make

- name: Install Minion
shell: bash
run: BIN_DIR=${HOME}/.local/bin etc/build/install-minion.sh

- name: Simple test
shell: bash
run: |
echo "find x : set of int(1..5) such that sum(x)=5" > test.essence
conjure solve test.essence --number-of-solutions=all --solutions-in-one-file --output-format=json
cat test.solutions.json
diff <(echo '[{"x":[5]},{"x":[2,3]},{"x":[1,4]}]' | tr -d '[:space:]') <(cat test.solutions.json | tr -d '[:space:]')
85 changes: 85 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Publishing Docker image to ghcr.io

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:
workflow_dispatch: # can be triggered manually
workflow_run: # run only when all tests pass
branches:
- main
workflows:
- Running all tests
types:
- completed
push: # for pushes to release tags (v*)
tags:
- "v*.*.*"
pull_request: # and for PRs that edit the docker files
paths:
- Dockerfile
- .github/workflows/docker-publish.yml
# other branches that want testing must create a PR


env:
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}


jobs:

Job:

# if this was triggered through a completed run of "Running all tests", we check if the run completed successfully
# if it was triggered through a PR, we just run it
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}

runs-on: ubuntu-latest

permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write

steps:

- name: Checkout repository
uses: actions/checkout@v3

# Set up buildx (Docker CLI plugin for extended build capabilities with BuildKit)
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2

# Login against a Docker registry except on PR
- name: Log into registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Extract metadata (tags, labels) for Docker
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# Build and push Docker image with Buildx (don't push on PR)
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v3
with:
context: .
push: ${{ github.event_name != 'pull_request' }} # do not push if this was triggered by a PR
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
144 changes: 144 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
name: Make a release

on:
workflow_dispatch: # can be triggered manually
push:
tags:
- "v*.*.*"
pull_request: # and for PRs
paths:
- conjure-cp.cabal
- Makefile
- src/**
- tests/**
- etc/build/**
- etc/savilerow/**
- .github/workflows/release.yml
# other branches that want testing must create a PR

permissions:
contents: write

jobs:

Job:

strategy:
matrix:
GHC_VERSION: ["9.4"]
os: [ubuntu-latest, macos-latest]
include:
- os: ubuntu-latest
release_suffix: linux
- os: macos-latest
release_suffix: macos-intel

runs-on: ${{ matrix.os }}

steps:

- uses: actions/checkout@v3
name: Checkout repository

- name: Stack version
shell: bash
run: GHC_VERSION=${{ matrix.GHC_VERSION }} make stack.yaml

- uses: actions/cache@v3
name: Cache stack
with:
path: |
~/.stack
.stack-work
key: stack-${{ runner.os }}-ghc${{ matrix.GHC_VERSION }}-${{ github.event.repository.updated_at }}
restore-keys: stack-${{ runner.os }}-ghc${{ matrix.GHC_VERSION }}

- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ runner.os }}

- name: Setting PATH
shell: bash
run: echo "${HOME}/.local/bin" >> ${GITHUB_PATH}

- name: Build Conjure
shell: bash
run: BIN_DIR=${HOME}/.local/bin GHC_VERSION=${{ matrix.GHC_VERSION }} BUILD_TESTS=true make

- name: Setting PATH (for solvers)
shell: bash
run: |
echo "${HOME}/solver-binaries" >> ${GITHUB_PATH}
echo "/usr/lib/ccache" >> ${GITHUB_PATH}
echo "/usr/local/opt/ccache/libexec" >> ${GITHUB_PATH}
- name: Installing dependencies (gperf) on Linux
shell: bash
run: sudo apt-get install -y gperf
if: runner.os == 'Linux'

- name: Installing dependencies (gperf) on macOS
shell: bash
run: brew install gperf
if: runner.os == 'macOS'

- name: Build solvers
shell: bash
run: |
rm -rf ${HOME}/solver-binaries
BIN_DIR=${HOME}/solver-binaries PROCESSES=2 make solvers
- name: Set version string to the commit hash
run: echo "RELEASE_VERSION=${{ github.sha }}" >> "$GITHUB_ENV"

- name: Set version string based on trigger (ref_name if on tag)
run: echo "RELEASE_VERSION=${{ github.ref_name }}" >> "$GITHUB_ENV"
if: startsWith(github.ref, 'refs/tags/')

- name: Set version string based on trigger (PR number if a PR)
run: echo "RELEASE_VERSION=${{ github.event.pull_request.number }}" >> "$GITHUB_ENV"
if: github.event_name == 'pull_request'

- name: Create the zip archives
shell: bash
run: |
pushd ${HOME}/solver-binaries
cp ~/.local/bin/conjure ~/.local/bin/savilerow ~/.local/bin/savilerow.jar .
mkdir -p lib
cp -r ~/.local/bin/lib/* lib/
cd ..
rm -rf conjure-${RELEASE_VERSION}-${{ matrix.release_suffix }}-with-solvers
cp -r solver-binaries conjure-${RELEASE_VERSION}-${{ matrix.release_suffix }}-with-solvers
cd solver-binaries
cp -r ../conjure-${RELEASE_VERSION}-${{ matrix.release_suffix }}-with-solvers .
rm -rf conjure-${RELEASE_VERSION}-${{ matrix.release_suffix }}
mkdir conjure-${RELEASE_VERSION}-${{ matrix.release_suffix }}
cp conjure conjure-${RELEASE_VERSION}-${{ matrix.release_suffix }}
zip -r -9 conjure-${RELEASE_VERSION}-${{ matrix.release_suffix }}.zip conjure-${RELEASE_VERSION}-${{ matrix.release_suffix }}
zip -r -9 conjure-${RELEASE_VERSION}-${{ matrix.release_suffix }}-with-solvers.zip conjure-${RELEASE_VERSION}-${{ matrix.release_suffix }}-with-solvers
popd
cp ${HOME}/solver-binaries/conjure-${RELEASE_VERSION}-${{ matrix.release_suffix }}.zip .
cp ${HOME}/solver-binaries/conjure-${RELEASE_VERSION}-${{ matrix.release_suffix }}-with-solvers.zip .
# See https://github.com/softprops/action-gh-release
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${RELEASE_VERSION}
draft: false
prerelease: false
generate_release_notes: true
files: |
conjure-${RELEASE_VERSION}-${{ matrix.release_suffix }}.zip
conjure-${RELEASE_VERSION}-${{ matrix.release_suffix }}-with-solvers.zip
64 changes: 64 additions & 0 deletions .github/workflows/solvers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Building all solvers

on:
workflow_dispatch: # can be triggered manually
schedule:
- cron: '0 11 * * 1' # run at 11.00 every Monday
# we do not modify the install scripts or the Makefile very often,
# so we build the solvers once a week to make sure they still build OK.
push:
branches:
- main # run for the main branch
paths:
- etc/build/install*.sh
- Makefile
- .github/workflows/solvers.yml
pull_request: # and for PRs
paths:
- etc/build/install*.sh
- Makefile
- .github/workflows/solvers.yml
# other branches that want testing must create a PR

jobs:

Job:

strategy:
matrix:
os:
- ubuntu-latest
- macos-latest

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
name: Checkout repository

- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ runner.os }}

- name: Setting PATH
shell: bash
run: |
echo "${HOME}/.local/bin" >> ${GITHUB_PATH}
echo "/usr/lib/ccache" >> ${GITHUB_PATH}
echo "/usr/local/opt/ccache/libexec" >> ${GITHUB_PATH}
- name: Installing dependencies (gperf) on Linux
shell: bash
run: sudo apt-get install -y gperf
if: runner.os == 'Linux'

- name: Installing dependencies (gperf) on macOS
shell: bash
run: brew install gperf
if: runner.os == 'macOS'

- name: Building solvers
shell: bash
run: BIN_DIR=${HOME}/.local/bin PROCESSES=2 make solvers

Loading

0 comments on commit 2dfdcd8

Please sign in to comment.