Skip to content
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

run ci on pull request when forked #1155

Merged
merged 2 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: '(Pre)-Release'
on:
push:
branches:
- 'master'
- 'dev'
tags:
- 'v[0-9]*'

jobs:
Release:
runs-on: ubuntu-latest
steps:
- name: Checkout VerCors
uses: actions/checkout@v2
- name: Set Pre-release Tag
if: github.ref_name == 'dev'
run: |
git tag -f dev-prerelease
git push origin --tags
- name: Install Java
uses: actions/setup-java@v1
with:
java-version: 17
- name: Build Release
run: ./mill -j 0 vercors.main.release
- name: Set Properties
id: props
run: ./mill vercors.main.githubReleaseOutputs >> "$GITHUB_OUTPUT"
- name: Create Release
id: release
uses: softprops/action-gh-release@v1
with:
name: ${{ steps.props.outputs.RELEASE_NAME }}
tag_name: ${{ steps.props.outputs.TAG_NAME }}
body: ${{ steps.props.outputs.BODY }}
draft: false
prerelease: ${{ steps.props.output.PRERELEASE }}
files: |
out/vercors/main/unixTar.dest/*.tar.xz
out/vercors/main/macosTar.dest/*.tar.xz
out/vercors/main/winZip.dest/*.zip
out/vercors/main/deb.dest/*.deb
4 changes: 4 additions & 0 deletions .github/workflows/scalatest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ on:
- '**'
tags-ignore:
- dev-prerelease
pull_request:
branches:
- '**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Compile:
if: (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork)
runs-on: ubuntu-latest
steps:
- name: Checkout VerCors
Expand Down
39 changes: 38 additions & 1 deletion build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,26 @@ object vercors extends Module {

object main extends VercorsModule {
def key = "main"
def name = "VerCors"
def maintainer = "Pieter Bos <[email protected]>"
def homepage = Some("https://utwente.nl/vercors")
def executableName = "vercors"
def version = T { buildInfo.gitVersion() }
def summary = "A deductive verifier for concurrent and parallel software."
def description =
"""The VerCors verifier is a tool for deductive verification of concurrent
|and parallel software. VerCors can reason about programs written in
|different programming languages, such as Java, C and OpenCL, where
|the specifications are written in terms of pre-post-condition
|contracts using permission-based separation logic.""".stripMargin

def githubReleaseOutputs = T.command {
System.out.println(s"TAG_NAME=${buildInfo.gitVersionTag().get}")
System.out.println(s"RELEASE_NAME=${name()} ${version()}")
System.out.println(s"BODY=${if(buildInfo.gitIsPrerelease()) "Nightly Build" else "..."}")
System.out.println(s"PRERELEASE=${if(buildInfo.gitIsPrerelease()) "true" else "false"}")
}

def deps = Agg(
ivy"com.github.scopt::scopt:4.0.1",
)
Expand Down Expand Up @@ -546,11 +566,28 @@ object vercors extends Module {
def gitShortCommit = T.input { callOrElse("git", "rev-parse", "--short=8", "HEAD")("unknown") }
def gitHasChanges = T.input { callOrElse("git", "diff-index", "--name-only", "HEAD")("dummyChanges").nonEmpty }

def gitVersionTag = T.input {
val tags = callOrElse("git", "tag", "--points-at", "HEAD")("").split("\n")
tags.collectFirst {
case tag if tag.matches("^v[0-9]") => tag
case "dev-prerelease" => "dev-prerelease"
}
}

def gitIsPrerelease = T.input { gitVersionTag().contains("dev-prerelease") }

def gitVersion = T.input {
gitVersionTag() match {
case Some(tag) if tag.startsWith("v") => tag.substring(1)
case _ => "9999.9.9-SNAPSHOT"
}
}

def buildInfoPackageName = "vct.main"
override def buildInfoMembers = T {
Seq(
BuildInfo.Value("name", "VerCors"),
BuildInfo.Value("version", "2.0.0"),
BuildInfo.Value("version", gitVersion()),
BuildInfo.Value("scalaVersion", main.scalaVersion()),
BuildInfo.Value("sbtVersion", "-"),
BuildInfo.Value("currentBranch", gitBranch()),
Expand Down
4 changes: 2 additions & 2 deletions mill-build/util/src/util/ReleaseModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ trait ReleaseModule extends JavaModule with SeparatePackedResourcesModule {
def name: T[String] = T { this.getClass.getSimpleName.replace("$", "").capitalize }
def executableName: T[String] = T { name().toLowerCase }
def version: T[String] = T { "0.1-SNAPSHOT" }
def maintainer: T[String] = T { "Pieter Bos <[email protected]>" }
def maintainer: T[String] = T { "Unknown <[email protected]>" }
def summary: T[String] = T { s"${name()} test build" }
def description: T[String] = T { s"${name()} test build" }
def homepage: T[Option[String]] = T { None }
Expand Down Expand Up @@ -101,7 +101,7 @@ trait ReleaseModule extends JavaModule with SeparatePackedResourcesModule {
}

def deb = T {
val outName = s"${debianPackageName()}-debian-${version()}"
val outName = s"${debianPackageName()}-${version()}-debian"
val root = T.dest / outName
os.makeDir(root)
val dest = root / "usr" / "share" / debianPackageName()
Expand Down
Loading