Skip to content

Commit

Permalink
Don't run rcc build twice
Browse files Browse the repository at this point in the history
This is a problem since the same artefact is built twice. This is not allowed with the new release
actions.
  • Loading branch information
SoloJacobs committed Mar 8, 2024
1 parent f8ab678 commit 93ddb1a
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 32 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
runs-on: ubuntu-latest
outputs:
robotmk_yaml_changed: ${{ steps.filter.outputs.robotmk_yaml }}
rcc_yaml_changed: ${{ steps.filter.outputs.rcc_yaml }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
Expand All @@ -24,29 +23,26 @@ jobs:
filters: |
robotmk_yaml:
- '.github/workflows/robotmk_build.yaml'
rcc_yaml:
- '.github/workflows/rcc.yaml'
tests:
if: always()
uses: ./.github/workflows/tests.yaml

system_tests:
if: always()
uses: ./.github/workflows/system_tests.yaml

build_robotmk:
needs:
- analyse_changes
if: ${{ needs.analyse_changes.outputs.robotmk_yaml_changed == 'true' }}
uses: ./.github/workflows/robotmk_build.yaml

rcc:
needs:
- analyse_changes
if: ${{ needs.analyse_changes.outputs.rcc_yaml_changed == 'true' }}
uses: ./.github/workflows/rcc.yaml

system_tests:
uses: ./.github/workflows/system_tests.yaml
needs: rcc
with:
rcc_artifact_id: ${{ needs.rcc.outputs.rcc_artifact_id }}

check_success:
if: always()
runs-on: Ubuntu-latest
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/rcc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ name: "RCC"

on:
workflow_call:
{}

outputs:
rcc_artifact_id:
value: ${{ jobs.upload.outputs.rcc_artifact_id }}
env:
RCC_TAG: "b18cdacf4cd9dbc1c921b2c0acc1ab9e7d02dae9" # Update omd/Licenses.csv in the Checkmk repo when changing this.
GO_VERSION: "1.20.x"
Expand Down Expand Up @@ -48,6 +49,8 @@ jobs:

upload:
runs-on: ubuntu-latest
outputs:
rcc_artifact_id: ${{ steps.artifact-upload-step.outputs.artifact-id }}
needs:
- build_and_cache
# See https://github.com/actions/runner/issues/491 for the following condition
Expand All @@ -60,7 +63,9 @@ jobs:
path: build
key: rcc-${{ env.RCC_TAG }}-${{ env.GO_VERSION }}-${{ env.RUBY_VERSION }}
fail-on-cache-miss: true
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
id: artifact-upload-step
with:
path: build
name: rcc
path: build/
if-no-files-found: error
17 changes: 11 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,28 @@ on:
jobs:
tests:
uses: ./.github/workflows/tests.yaml
system_tests:
uses: ./.github/workflows/system_tests.yaml
build_rcc:
rcc:
uses: ./.github/workflows/rcc.yaml
system_tests:
needs: rcc
uses: ./.github/workflows/system_tests.yaml
with:
rcc_artifact_id: ${{ needs.rcc.outputs.rcc_artifact_id }}
build_robotmk:
uses: ./.github/workflows/robotmk_build.yaml
release:
runs-on: ubuntu-latest
needs: [tests, system_tests, build_rcc, build_robotmk]
needs: [tests, system_tests, rcc, build_robotmk]
steps:
- uses: actions/checkout@v4 # Determines the ref, which is used for the
# release. For setting a different ref, all `needs` jobs need to be
# adjusted. Currently, everything uses the default branch.

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
path: executables/

- run: zip -r executables.zip artifact
- run: zip -r executables.zip executables

- name: "Push release tag"
# This is publicly visible and needs to be manually fixed if any
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/robotmk_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ jobs:

- run: cargo build --target=x86_64-pc-windows-gnu --release

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: rmk_windows64
path: |
${{ github.workspace }}/target/x86_64-pc-windows-gnu/release/robotmk_scheduler.exe
${{ github.workspace }}/target/x86_64-pc-windows-gnu/release/robotmk_agent_plugin.exe
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/system_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@
name: "System tests"

on:
workflow_call: {}

workflow_call:
inputs:
rcc_artifact_id:
required: true
type: string
jobs:
rcc:
uses: ./.github/workflows/rcc.yaml

test_scheduler:
runs-on: windows-latest
needs:
- rcc
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
path: C:\
run-id: ${{ inputs.rcc_artifact_id }}
- uses: actions/checkout@v4
- uses: actions-rust-lang/[email protected]
with:
target: x86_64-pc-windows-gnu
- run: cargo test --target=x86_64-pc-windows-gnu --test test_scheduler -- --nocapture --ignored
env:
TEST_DIR: C:\test_scheduler
RCC_BINARY_PATH: C:\artifact\windows64\rcc.exe
RCC_BINARY_PATH: C:\rcc\windows64\rcc.exe
RUN_FOR: 240
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: system_test_debug_information
path: C:\test_scheduler

0 comments on commit 93ddb1a

Please sign in to comment.