-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): add simple workflows (#49)
- Loading branch information
Showing
5 changed files
with
156 additions
and
6 deletions.
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,100 @@ | ||
name: CI build and push | ||
|
||
concurrency: | ||
group: ci-${{ github.run_id }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- v[0-9]+ | ||
- v[0-9]+.[0-9]+ | ||
- cryostat-v[0-9]+.[0-9]+ | ||
pull_request_target: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- labeled | ||
- unlabeled | ||
branches: | ||
- main | ||
- v[0-9]+ | ||
- v[0-9]+.[0-9]+ | ||
- cryostat-v[0-9]+.[0-9]+ | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
java: [ '17', '20' ] | ||
env: | ||
TESTCONTAINERS_RYUK_DISABLED: true | ||
cache-name: cache-yarn | ||
name: Build and test Java ${{ matrix.java }} | ||
permissions: | ||
packages: write | ||
contents: read | ||
if: ${{ github.repository_owner == 'cryostatio' }} | ||
steps: | ||
# - name: Fail if PR and safe-to-test label NOT applied | ||
# if: ${{ github.event_name == 'pull_request_target' && !contains(github.event.pull_request.labels.*.name, 'safe-to-test') }} | ||
# run: exit 1 | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
submodules: true | ||
fetch-depth: 0 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
- name: maven-settings | ||
uses: s4u/maven-settings-action@v2 | ||
with: | ||
servers: '[{"id": "github", "username": "dummy", "password": "${{ secrets.GITHUB_TOKEN }}"}]' | ||
githubServer: false | ||
- run: git submodule init && git submodule update | ||
- name: Cache yarn packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: "./src/main/webui/.yarn/cache" | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Initialize web assets | ||
run: | | ||
cd src/main/webui | ||
yarn install && yarn yarn:frzinstall | ||
cd - | ||
- name: Update podman | ||
run: | | ||
sudo apt-get -y purge podman | ||
sudo mkdir -p /etc/apt/keyrings | ||
curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/Release.key | gpg --dearmor | sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null | ||
echo \ | ||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg] \ | ||
https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/ /" \ | ||
| sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null | ||
sudo apt-get update -qq | ||
sudo apt-get -qq -y install podman | ||
- name: Install podman-docker | ||
run: | | ||
sudo apt-get -y purge moby-cli | ||
sudo apt install -y podman-docker | ||
- name: Setup docker host | ||
run: echo "DOCKER_HOST=unix:///run/user/$(id -u)/podman/podman.sock" >> "$GITHUB_ENV" | ||
- name: Set up testcontainers for podman | ||
run: | | ||
echo ryuk.container.privileged=true > ~/.testcontainers.properties | ||
- run: systemctl --user enable --now podman.socket | ||
- name: Build db image | ||
run: sh db/build.sh | ||
- name: Run tests | ||
run: ./mvnw -B -U clean verify |
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,28 @@ | ||
name: Dependent Issues | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- reopened | ||
- synchronize | ||
|
||
# Schedule a daily check. Used in referencing cross-repository | ||
# issues or pull requests | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: z0al/dependent-issues@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
# (Optional) Enable checking for dependencies in issues. | ||
# Enable by setting the value to "on". Default "off" | ||
check_issues: off | ||
|
||
keywords: depends on, blocked by, based on |
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,19 @@ | ||
name: Require semantic labels | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- labeled | ||
- unlabeled | ||
- synchronize | ||
|
||
jobs: | ||
check-pr-label-and-comment: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: yashhy/[email protected] | ||
with: | ||
# This list is duplicated from release-drafter.yml | ||
required_labels: 'chore,ci,cleanup,docs,feat,fix,perf,refactor,style,test' | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
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