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 55cfb32
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 32 deletions.
16 changes: 5 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,24 @@ 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:
needs: rcc
uses: ./.github/workflows/system_tests.yaml

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

on:
workflow_call:
{}
workflow_call: {}

env:
RCC_TAG: "b18cdacf4cd9dbc1c921b2c0acc1ab9e7d02dae9" # Update omd/Licenses.csv in the Checkmk repo when changing this.
Expand Down Expand Up @@ -60,7 +59,8 @@ 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
with:
path: build
name: rcc
path: build/
if-no-files-found: error
13 changes: 8 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,24 @@ 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
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: artifact/

- run: zip -r executables.zip artifact

Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/robotmk_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ name: "Build Robotmk"

on:
workflow_call: {}

jobs:
build_robotmk_from_source:
build_robotmk:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

Expand All @@ -17,8 +15,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
13 changes: 5 additions & 8 deletions .github/workflows/system_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@ on:
workflow_call: {}

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:
name: rcc
path: C:\
- uses: actions/checkout@v4
- uses: actions-rust-lang/[email protected]
Expand All @@ -23,8 +19,9 @@ jobs:
- 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 55cfb32

Please sign in to comment.