+
Skip to content

Setup CI nightly build #95

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

Merged
merged 1 commit into from
Oct 24, 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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Keycloak Client CI
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/release-nightly.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Keycloak Client Nightly Release

on:
schedule:
- cron: '0 2 * * *'
workflow_dispatch:

jobs:
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/schedule-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Scheduled nightly workflows

on:
schedule:
- cron: '0 2 * * *'
workflow_dispatch:

jobs:

run-ci:
name: Run nightly workflows
runs-on: ubuntu-latest
if: github.event_name != 'schedule' || github.repository == 'keycloak/keycloak-client'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this 'not schedule' condition?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've copy/pasted it from some other places :-) Like for example https://github.com/keycloak/keycloak/blob/main/.github/workflows/schedule-nightly.yml#L11 or https://github.com/keycloak/keycloak-quickstarts/blob/latest/.github/workflows/schedule.yml#L15 .

If I understand correctly, the aim of this condition is this (please correct me if I am wrong):

  1. The action will executed every night in the keycloak/keycloak-client repository

  2. The action will NOT be executed periodically in the forked repositories like mposolda/keycloak-client .

  3. Someone in the forked repository still has a way to run this action manually in his repository if he wants to.

I believe this condition is exactly used for that. On the other hand, running the "release nightly" in the forked repository will always fail (as some secrets are needed in GH to push the stuff into maven etc). It makes sense that someone has a way to run CI action in his repository, but "release nightly" probably does not makes sense. So maybe I can just remove the "not schedule" condition and keep just if: github.repository == 'keycloak/keycloak-client' . WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably fine like this, was just wondering about the reason behind it. LGTM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Ok, let's keep it like that. Might be useful as it will allow to trigger more CI jobs at the same time like we're doing for the keycloak/keycloak (for keycloak-client, we will probably also have something for #87 )


strategy:
matrix:
workflow:
- ci.yml
- release-nightly.yml

steps:
- run: gh workflow run -R ${{ github.repository }} ${{ matrix.workflow }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载