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

Add stub of workflow for checking the state of upstream project #261

Merged
merged 1 commit into from
Oct 28, 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
36 changes: 36 additions & 0 deletions .github/workflows/check-upstream.main.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env kotlin
@file:Repository("https://repo1.maven.org/maven2/")
@file:DependsOn("io.github.typesafegithub:github-workflows-kt:3.0.1")

@file:Repository("https://bindings.krzeminski.it/")
@file:DependsOn("actions:checkout:v4")

import io.github.typesafegithub.workflows.actions.actions.Checkout
import io.github.typesafegithub.workflows.domain.RunnerType
import io.github.typesafegithub.workflows.domain.triggers.WorkflowDispatch
import io.github.typesafegithub.workflows.dsl.workflow

workflow(
name = "Build",
on = listOf(
WorkflowDispatch(),
),
sourceFile = __FILE__,
) {
job(
id = "check",
runsOn = RunnerType.UbuntuLatest,
) {
uses(action = Checkout())
run(
name = "Clone snakeyaml-engine",
command = "git clone https://bitbucket.org/snakeyaml/snakeyaml-engine.git && cd snakeyaml-engine"
)
run(
name = "Calculate changes between the last synced change and current state",
// TODO: store this commit hash in a file
// TODO: get the numerical value (| wc -l)
command = "git log --oneline ef7ebe9c06e963e13f4ab465f300a0dd6f0940c9..master"
)
}
}
34 changes: 34 additions & 0 deletions .github/workflows/check-upstream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This file was generated using Kotlin DSL (.github/workflows/check-upstream.main.kts).
# If you want to modify the workflow, please change the Kotlin file and regenerate this YAML file.
# Generated with https://github.com/typesafegithub/github-workflows-kt

name: 'Build'
on:
workflow_dispatch: {}
jobs:
check_yaml_consistency:
name: 'Check YAML consistency'
runs-on: 'ubuntu-latest'
steps:
- id: 'step-0'
name: 'Check out'
uses: 'actions/checkout@v4'
- id: 'step-1'
name: 'Execute script'
run: 'rm ''.github/workflows/check-upstream.yaml'' && ''.github/workflows/check-upstream.main.kts'''
- id: 'step-2'
name: 'Consistency check'
run: 'git diff --exit-code ''.github/workflows/check-upstream.yaml'''
check:
runs-on: 'ubuntu-latest'
needs:
- 'check_yaml_consistency'
steps:
- id: 'step-0'
uses: 'actions/checkout@v4'
- id: 'step-1'
name: 'Clone snakeyaml-engine'
run: 'git clone https://bitbucket.org/snakeyaml/snakeyaml-engine.git && cd snakeyaml-engine'
- id: 'step-2'
name: 'Calculate changes between the last synced change and current state'
run: 'git log --oneline ef7ebe9c06e963e13f4ab465f300a0dd6f0940c9..master'