Skip to content

Commit

Permalink
Add stub of workflow for checking the state of upstream project (#261)
Browse files Browse the repository at this point in the history
Part of #260.

Adding such simple workflow to be able to run it through the UI, and
further iterate on it.
  • Loading branch information
krzema12 authored Oct 28, 2024
1 parent ac2a4f1 commit f110718
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
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'

0 comments on commit f110718

Please sign in to comment.