Unverified Commit ee4408af authored by Gautier de Saint Martin Lacaze's avatar Gautier de Saint Martin Lacaze Committed by GitHub
Browse files

Merge pull request #823 from gitlab4j/migrate-to-github-actions

Enable build on GitHub Actions
parents ece38ecd 495920d7
name: Build
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B test org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
name: GitLab4J CI
on:
push:
branches-ignore:
- 'dependabot/**'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
jobs:
build-jdk8:
name: "Build JDK 8"
runs-on: ubuntu-latest
services:
gitlab-instance:
image: gitlab/gitlab-ce:12.9.2-ce.0
env:
GITLAB_OMNIBUS_CONFIG: gitlab_rails['initial_root_password']="password";gitlab_rails['lfs_enabled']=false;
ports:
- 8090:80
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
distribution: adopt-hotspot
java-version: 8
- name: Get Date
id: get-date
run: |
echo "::set-output name=date::$(/bin/date -u "+%Y-%m")"
shell: bash
- name: Cache Maven Repository
id: cache-maven
uses: actions/cache@v2
with:
path: ~/.m2/repository
# refresh cache every month to avoid unlimited growth
key: gitlab4jmaven-${{ steps.get-date.outputs.date }}
- name: GitLab4j verify
id: gitlab4j-verify
run: |
./mvnw integration-test -B -V -Dmaven.javadoc.skip=true
language: java
sudo: required
services:
- docker
jdk:
- openjdk8
install:
- ./mvnw install -B -q -Dgpg.skip=true -DskipTests=true -Dmaven.javadoc.skip=true
before_script:
- ./mvnw docker:start -B -Dgitlab.skip-docker-start=false
script:
- ./mvnw integration-test -B -V -Dmaven.javadoc.skip=true
after_script:
- ./mvnw docker:stop -B -Dgitlab.skip-docker-start=false
after_failure:
- ./mvnw docker:stop -B -Dgitlab.skip-docker-start=false
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment