From bbc08f9adf8cb740325cdf3fbd4ab8a714808a9c Mon Sep 17 00:00:00 2001 From: Colin Davidson Date: Fri, 4 Oct 2024 15:54:50 +0100 Subject: [PATCH 1/6] Update workflow1.yml --- .github/workflows/workflow1.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/workflow1.yml b/.github/workflows/workflow1.yml index 89b5bed..ad74743 100644 --- a/.github/workflows/workflow1.yml +++ b/.github/workflows/workflow1.yml @@ -28,22 +28,22 @@ jobs: echo "LLVM_VERSION=${{ inputs.llvm_version }}" >> $GITHUB_ENV" echo "UPDATE_CACHE=${{ inputs.update_cache }}" >> $GITHUB_ENV" - run-on-pull: - if: ${{ github.event_name == 'pull_request' }} - runs-on: ubuntu-latest - steps: - - name: Print the input tag to STDOUT - run: | - echo The llvm_version are ${{ inputs.llvm_version }}, update_cache is ${{ inputs.update_cache }} - cat "$GITHUB_ENV" - echo ${{ github.event }} - echo "LLVM_VERSION=18" >> $env:GITHUB_ENV" - echo "UPDATE_CACHE=false" >> $env:GITHUB_ENV" + # run-on-pull: + # if: ${{ github.event_name == 'pull_request' }} + # runs-on: ubuntu-latest + # steps: + # - name: Print the input tag to STDOUT + # run: | + # echo The llvm_version are ${{ inputs.llvm_version }}, update_cache is ${{ inputs.update_cache }} + # cat "$GITHUB_ENV" + # echo ${{ github.event }} + # echo "LLVM_VERSION=18" >> $env:GITHUB_ENV" + # echo "UPDATE_CACHE=false" >> $env:GITHUB_ENV" run-on-pull_2: name: Call other workflow if: ${{ github.event_name == 'pull_request' }} - needs: run-on-pull + # needs: run-on-pull uses: ./.github/workflows/workflow_callee.yml with: llvm_version: 18 From d922b8adc72a863288697d8f0e522522799ff518 Mon Sep 17 00:00:00 2001 From: Colin Davidson Date: Wed, 9 Oct 2024 17:44:45 +0100 Subject: [PATCH 2/6] More stuff --- .github/workflows/workflow_callee.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/workflow_callee.yml b/.github/workflows/workflow_callee.yml index 83e7d2d..6eb96e3 100644 --- a/.github/workflows/workflow_callee.yml +++ b/.github/workflows/workflow_callee.yml @@ -18,12 +18,29 @@ on: pull_request: paths: - '.github/workflows/workflow_callee.yml' + +env: + LLVM_VERSION: 17 + UPDATE_CACHE: false jobs: + update-values: + runs-on: ubuntu-latest + steps: + - name: update envs + run: | + if [ -n "${{ inputs.llvm_version}}" ]; then + echo LLVM_VERSION=${{ inputs.llvm_version}} >> $GITHUB_ENV + echo UPDATE_CACHE=${{ inputs.update_cache}} >> $GITHUB_ENV + fi + cat $GITHUB_ENV + print-inputs: runs-on: ubuntu-latest + needs: update-values steps: - name: Print the input tag to STDOUT run: | echo ${{ inputs.llvm_version }} echo ${{ inputs.update_cache }} + echo LLVM="$LLVM_VERSION" CACHE="$UPDATE_CACHE" From 8e81ce50f7a74b0f8108a15b72bc169afe8858ab Mon Sep 17 00:00:00 2001 From: Colin Davidson Date: Fri, 18 Oct 2024 16:52:33 +0100 Subject: [PATCH 3/6] trying artefacts --- .github/workflows/workflow1.yml | 101 +++++++++++++++----------- .github/workflows/workflow_callee.yml | 6 +- 2 files changed, 62 insertions(+), 45 deletions(-) diff --git a/.github/workflows/workflow1.yml b/.github/workflows/workflow1.yml index ad74743..f718039 100644 --- a/.github/workflows/workflow1.yml +++ b/.github/workflows/workflow1.yml @@ -1,51 +1,68 @@ on: - workflow_dispatch: - inputs: - llvm_version: - description: 'Log level' - default: 18 - type: choice - options: - - 17 - - 18 - - 19 - update_cache: - description: 'update_cache' - default: false - type: boolean pull_request: jobs: - print-tag: - runs-on: ubuntu-latest - if: ${{ github.event_name == 'workflow_dispatch' }} + job_1: + runs-on: ubuntu-latest steps: - - name: Print the input tag to STDOUT + - name: cp ls run: | - echo The llvm_version are ${{ inputs.llvm_version }}, benchmark_testing is ${{ inputs.update_cache }} - cat "$GITHUB_ENV" - echo ${{ github.event }} - echo "LLVM_VERSION=${{ inputs.llvm_version }}" >> $GITHUB_ENV" - echo "UPDATE_CACHE=${{ inputs.update_cache }}" >> $GITHUB_ENV" + wget https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.1/LLVM-19.1.1-Linux-X64.tar.xz + cp LLVM-19.1.1-Linux-X64.tar.xz foo.tar.xz + cp LLVM-19.1.1-Linux-X64.tar.xz foo2.tar.xz + cp LLVM-19.1.1-Linux-X64.tar.xz foo3.tar.xz + cp LLVM-19.1.1-Linux-X64.tar.xz foo4.tar.xz + ls -l foo* + + - name: 'Upload Artifact' + uses: actions/upload-artifact@v4 + with: + name: ock + path: foo.tar.xz + retention-days: 5 - # run-on-pull: - # if: ${{ github.event_name == 'pull_request' }} - # runs-on: ubuntu-latest - # steps: - # - name: Print the input tag to STDOUT - # run: | - # echo The llvm_version are ${{ inputs.llvm_version }}, update_cache is ${{ inputs.update_cache }} - # cat "$GITHUB_ENV" - # echo ${{ github.event }} - # echo "LLVM_VERSION=18" >> $env:GITHUB_ENV" - # echo "UPDATE_CACHE=false" >> $env:GITHUB_ENV" + - name: 'Upload Artifact' + uses: actions/upload-artifact@v4 + with: + name: ock2 + path: foo2.tar.xz + retention-days: 5 - run-on-pull_2: - name: Call other workflow - if: ${{ github.event_name == 'pull_request' }} - # needs: run-on-pull - uses: ./.github/workflows/workflow_callee.yml - with: - llvm_version: 18 - update_cache: true + - name: 'Upload Artifact' + uses: actions/upload-artifact@v4 + with: + name: ock3 + path: foo3.tar.xz + retention-days: 5 + - name: 'Upload Artifact' + uses: actions/upload-artifact@v4 + with: + name: ock4 + path: foo4.tar.xz + retention-days: 5 + + job_2: + name: do ls + needs: job_1 + runs-on: ubuntu-latest + steps: + - name: Download math result for job 1 + uses: actions/download-artifact@v4 + with: + name: ock + - name: Download math result for job 1 + uses: actions/download-artifact@v4 + with: + name: ock2 + - name: Download math result for job 1 + uses: actions/download-artifact@v4 + with: + name: ock3 + - name: Download math result for job 1 + uses: actions/download-artifact@v4 + with: + name: ock4 + - shell: bash + run: | + ls -l foo* diff --git a/.github/workflows/workflow_callee.yml b/.github/workflows/workflow_callee.yml index 6eb96e3..09f2478 100644 --- a/.github/workflows/workflow_callee.yml +++ b/.github/workflows/workflow_callee.yml @@ -15,9 +15,9 @@ on: update_cache: required: true type: boolean - pull_request: - paths: - - '.github/workflows/workflow_callee.yml' + # pull_request: + # paths: + # - '.github/workflows/workflow_callee.yml' env: LLVM_VERSION: 17 From 8471a1a8b5eecba43c25f004dc4b8c4a3f13530d Mon Sep 17 00:00:00 2001 From: Colin Davidson Date: Fri, 25 Oct 2024 09:20:33 +0100 Subject: [PATCH 4/6] TBD --- .github/workflows/workflow1.yml | 199 ++++++++++++++++++-------- .github/workflows/workflow_callee.yml | 52 +++---- 2 files changed, 164 insertions(+), 87 deletions(-) diff --git a/.github/workflows/workflow1.yml b/.github/workflows/workflow1.yml index f718039..2185289 100644 --- a/.github/workflows/workflow1.yml +++ b/.github/workflows/workflow1.yml @@ -1,68 +1,151 @@ on: pull_request: +env: + target_list: '["x64","aarch64", "riscv64"]' + os_list: '["ubuntu-22.04", "windows-2019"]' + jobs: - job_1: - runs-on: ubuntu-latest + # job1: + # runs-on: ubuntu-latest + # outputs: + # matrix: ${{ steps.set-matrix.outputs.matrix_include }} + # steps: + # - id: set-matrix + # run: echo "matrix_include=[{\"project\":\"foo\",\"config\":\"Debug\"},{\"project\":\"bar\",\"config\":\"Release\"}]" >> $GITHUB_OUTPUT + + job2: + # needs: job1 + runs-on: ubuntu-latest + strategy: + matrix: + target: [x64, aarch64] + include: + - os_flags: wibble + - os_flags: wibble_x64 + target: x64 + #${{fromJson('[{"os_flags":"wibble"},{"os_flags":"bar","targets":"x64"}]')}} + # {\"include\":[{\"project\":\"foo\",\"config\":\"Debug\"},{\"project\":\"bar\",\"config\":\"Release\"}]} + # {\"include\":[{\"project\":\"foo\",\"config\":\"Debug\"},{\"project\":\"bar\",\"config\":\"Release\"}]} + # needs.job1.outputs.matrix_include)}} + # targets: ["x64","aarch64", "riscv64"] + # include: ${{toJSON(needs.job1.outputs.matrix_include)}} steps: - - name: cp ls - run: | - wget https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.1/LLVM-19.1.1-Linux-X64.tar.xz - cp LLVM-19.1.1-Linux-X64.tar.xz foo.tar.xz - cp LLVM-19.1.1-Linux-X64.tar.xz foo2.tar.xz - cp LLVM-19.1.1-Linux-X64.tar.xz foo3.tar.xz - cp LLVM-19.1.1-Linux-X64.tar.xz foo4.tar.xz - ls -l foo* + - run: | + echo ${{ toJSON(matrix.targets) }} + echo ${{ toJson(matrix.include) }} + echo target=${{ matrix.targets }} + echo os_flags=${{ matrix.os_flags }} + + # calc_matrix: + # runs-on: ubuntu-latest + # name: Calc matrix + # outputs: + # matrix: ${{ steps.step1.outputs.matrix }} + # # os_list: ${{ steps.step1.outputs.os_list }} + # steps: + # - uses: actions/checkout@v3 + # - id: step1 + # run: | + # # echo "target_list=$target_list" >> "$GITHUB_OUTPUT" + # echo "matrix="{\"include\":[{\"project\":\"foo\",\"config\":\"Debug\"},{\"project\":\"bar\",\"config\":\"Release\"}]}" >> $GITHUB_OUTPUT + # run_matrix: + # runs-on: ubuntu-latest + # needs: calc_matrix + # strategy: + # matrix: ${{ fromJson(needs.calc_matrix.outputs.matrix) }} + # # target: ${{ fromJson(needs.calc_matrix.outputs.target_list) }} + # # include: ${{ fromJson(needs.calc_matrix.outputs.extra_vars) }} + # # {\"include\":[{\"project\":\"foo\",\"config\":\"Debug\"},{\"project\":\"bar\",\"config\":\"Release\"}]} + # steps: + # - uses: actions/setup-node@v3 + # - run: echo "${{ matrix.target }}:${{ matrix.project }}" + # filter_matrix: + # runs-on: ubuntu-latest + # needs: affected-apps + # outputs: + # apps: ${{ steps.step1.outputs.filtered }} + # steps: + # - id: step1 + # run: | + # echo "$APPS" + # RESULT=$(echo $APPS | jq -c --argjson toRemove '["app1", "app2"]' 'map(select(. as $v | $toRemove | index($v) | not))') + # echo "$RESULT" + # echo "filtered=$RESULT" >> "$GITHUB_OUTPUT" + # env: + # APPS: ${{ needs.affected-apps.outputs.apps }} + # filtered_matrix: + # runs-on: ubuntu-latest + # needs: filter_matrix + # strategy: + # matrix: + # app: ${{ fromJson(needs.filter_matrix.outputs.apps) }} + # steps: + # - uses: actions/setup-node@v3 + # - run: echo "${{ matrix.app }}" + +# jobs: +# job_1: +# runs-on: ubuntu-latest +# steps: +# - name: cp ls +# run: | +# wget https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.1/LLVM-19.1.1-Linux-X64.tar.xz +# cp LLVM-19.1.1-Linux-X64.tar.xz foo.tar.xz +# cp LLVM-19.1.1-Linux-X64.tar.xz foo2.tar.xz +# cp LLVM-19.1.1-Linux-X64.tar.xz foo3.tar.xz +# cp LLVM-19.1.1-Linux-X64.tar.xz foo4.tar.xz +# ls -l foo* - - name: 'Upload Artifact' - uses: actions/upload-artifact@v4 - with: - name: ock - path: foo.tar.xz - retention-days: 5 +# - name: 'Upload Artifact' +# uses: actions/upload-artifact@v4 +# with: +# name: ock +# path: foo.tar.xz +# retention-days: 5 - - name: 'Upload Artifact' - uses: actions/upload-artifact@v4 - with: - name: ock2 - path: foo2.tar.xz - retention-days: 5 +# - name: 'Upload Artifact' +# uses: actions/upload-artifact@v4 +# with: +# name: ock2 +# path: foo2.tar.xz +# retention-days: 5 - - name: 'Upload Artifact' - uses: actions/upload-artifact@v4 - with: - name: ock3 - path: foo3.tar.xz - retention-days: 5 - - name: 'Upload Artifact' - uses: actions/upload-artifact@v4 - with: - name: ock4 - path: foo4.tar.xz - retention-days: 5 +# - name: 'Upload Artifact' +# uses: actions/upload-artifact@v4 +# with: +# name: ock3 +# path: foo3.tar.xz +# retention-days: 5 +# - name: 'Upload Artifact' +# uses: actions/upload-artifact@v4 +# with: +# name: ock4 +# path: foo4.tar.xz +# retention-days: 5 - job_2: - name: do ls - needs: job_1 - runs-on: ubuntu-latest - steps: - - name: Download math result for job 1 - uses: actions/download-artifact@v4 - with: - name: ock - - name: Download math result for job 1 - uses: actions/download-artifact@v4 - with: - name: ock2 - - name: Download math result for job 1 - uses: actions/download-artifact@v4 - with: - name: ock3 - - name: Download math result for job 1 - uses: actions/download-artifact@v4 - with: - name: ock4 - - shell: bash - run: | - ls -l foo* +# job_2: +# name: do ls +# needs: job_1 +# runs-on: ubuntu-latest +# steps: +# - name: Download math result for job 1 +# uses: actions/download-artifact@v4 +# with: +# name: ock +# - name: Download math result for job 1 +# uses: actions/download-artifact@v4 +# with: +# name: ock2 +# - name: Download math result for job 1 +# uses: actions/download-artifact@v4 +# with: +# name: ock3 +# - name: Download math result for job 1 +# uses: actions/download-artifact@v4 +# with: +# name: ock4 +# - shell: bash +# run: | +# ls -l foo* diff --git a/.github/workflows/workflow_callee.yml b/.github/workflows/workflow_callee.yml index 09f2478..790fbc7 100644 --- a/.github/workflows/workflow_callee.yml +++ b/.github/workflows/workflow_callee.yml @@ -1,12 +1,9 @@ on: workflow_call: inputs: - llvm_version: + arch_list: required: true type: string - update_cache: - required: true - type: boolean workflow_dispatch: inputs: llvm_version: @@ -19,28 +16,25 @@ on: # paths: # - '.github/workflows/workflow_callee.yml' -env: - LLVM_VERSION: 17 - UPDATE_CACHE: false -jobs: - update-values: - runs-on: ubuntu-latest - steps: - - name: update envs - run: | - if [ -n "${{ inputs.llvm_version}}" ]; then - echo LLVM_VERSION=${{ inputs.llvm_version}} >> $GITHUB_ENV - echo UPDATE_CACHE=${{ inputs.update_cache}} >> $GITHUB_ENV - fi - cat $GITHUB_ENV - - print-inputs: - runs-on: ubuntu-latest - needs: update-values - steps: - - name: Print the input tag to STDOUT - run: | - echo ${{ inputs.llvm_version }} - echo ${{ inputs.update_cache }} - echo LLVM="$LLVM_VERSION" CACHE="$UPDATE_CACHE" - +# env: +# LLVM_VERSION: 17 +# UPDATE_CACHE: false +# jobs: +# # affected-apps: +# # runs-on: ubuntu-latest +# # name: A job to say hello +# # outputs: +# # apps: ${{ steps.step1.outputs.test}} +# # steps: +# # - uses: actions/checkout@v3 +# # - id: step1 +# # run: echo "test=$arch_list" >> "$GITHUB_OUTPUT" +# example_matrix: +# runs-on: ubuntu-latest +# # needs: affected-apps +# strategy: +# matrix: +# app: ${{ fromJson(${{ inputs.arch_list }}) }} +# steps: +# - uses: actions/setup-node@v3 +# - run: echo "${{ matrix.app }}" From c0dbb65249c274570b9d02c84324a3b910630c39 Mon Sep 17 00:00:00 2001 From: Colin Davidson Date: Fri, 15 Nov 2024 18:01:35 +0000 Subject: [PATCH 5/6] TBD2 --- .github/actions/calc_vars/action.yml | 22 ++++++ .github/workflows/workflow1.yml | 99 ++++++++++++++++++++++----- .github/workflows/workflow_callee.yml | 40 ----------- 3 files changed, 105 insertions(+), 56 deletions(-) create mode 100644 .github/actions/calc_vars/action.yml delete mode 100644 .github/workflows/workflow_callee.yml diff --git a/.github/actions/calc_vars/action.yml b/.github/actions/calc_vars/action.yml new file mode 100644 index 0000000..a19d92c --- /dev/null +++ b/.github/actions/calc_vars/action.yml @@ -0,0 +1,22 @@ +name: calc vars +description: calc vars + +# Some of these are riscv or host target specific, but it does not harm at present to +# overset cmake values +inputs: + target: + description: 'TBD' + default: host_x86 + +outputs: + arch: + value: ${{ steps.calc_vars.outputs.arch }} +runs: + # We don't want a new docker just a list of steps, so mark as composite + using: "composite" + steps: + # - + - shell: ${{ inputs.shell_to_use }} + id: calc_vars + run: + echo "arch=aarch64" >> $GITHUB_OUTPUT diff --git a/.github/workflows/workflow1.yml b/.github/workflows/workflow1.yml index 2185289..83547af 100644 --- a/.github/workflows/workflow1.yml +++ b/.github/workflows/workflow1.yml @@ -12,30 +12,97 @@ jobs: # matrix: ${{ steps.set-matrix.outputs.matrix_include }} # steps: # - id: set-matrix - # run: echo "matrix_include=[{\"project\":\"foo\",\"config\":\"Debug\"},{\"project\":\"bar\",\"config\":\"Release\"}]" >> $GITHUB_OUTPUT + # run: | + # # echo "matrix_include=[{\"os_flags\": \"wibble\"},{\"os_flags\": \"wibble_x64\", \"target\": \"x64\"}]" >> $GITHUB_OUTPUT + # echo 'matrix_include=["os_flags", "wibble"]' >> $GITHUB_OUTPUT + # cat $GITHUB_OUTPUT - job2: - # needs: job1 + calc_matrix: runs-on: ubuntu-latest - strategy: - matrix: - target: [x64, aarch64] - include: - - os_flags: wibble - - os_flags: wibble_x64 - target: x64 + name: Calc matrix + outputs: + target: ${{ steps.step1.outputs.target }} + # matrix_include: ${{ steps.step1.outputs.matrix_include }} + steps: + - id: step1 + run: | + # # python ./github/scripts/update_vars.py >> "$GITHUB_OUTPUT" + # # echo "target_list=$target_list" >> "$GITHUB_OUTPUT" + # # echo "os_list=$os_list" >> "$GITHUB_OUTPUT" + # echo 'target=["x86", "aarch64"]' >> "$GITHUB_OUTPUT" + # # echo 'os_list=["os_flags", "wibble"]' >> "$GITHUB_OUTPUT" + # # echo 'matrix_include=[{"os_flags": "wibble"},{"os_flags": "wibble_x64", "target": "x86"}]' >> $GITHUB_OUTPUT + echo 'target=[ "host_x86", "host_aarch64"]' >> $GITHUB_OUTPUT + cat $GITHUB_OUTPUT + + # create_ock_artefacts: + # # needs: calc_matrix + # strategy: + # matrix: + + # target: ["x86", "aarch64"] + # # target: ${{ fromJson(needs.calc_matrix.outputs.target) }} + # # include: ${{ fromJson(needs.calc_matrix.outputs.matrix_include) }} + # exclude: + # - target: x86 + # # os: ${{ fromJson(needs.calc_matrix.outputs.os_list) }} + # # build_type: [RelAssert] + # # exclude: + # # - os: windows-2019 + # # - target: riscv64 + # # - target: aarch64 + create_ock_artefacts: + runs-on: ubuntu-latest + needs: calc_matrix + steps: + # - name: Checkout repo + # uses: actions/checkout@v4.1.0 + # - id: calc_vars2 + # uses: ./.github/actions/calc_vars + # with: + # target: ${{ matrix.target }} + # - id: calc_vars + # run: + # echo "arch=aarch64" >> $GITHUB_OUTPUT + - if: ${{ contains(needs.calc_matrix.outputs.target, 'host_x86') }} + run: | + # echo target=${{ matrix.target }} + # echo arch=${{ steps.calc_vars2.outputs.arch }} + # echo arch=${{ steps.calc_vars.outputs.arch }} + # echo arch=${{ fromJson('{"host_x86":{"arch": "x86_64"},"host_aarch64":{"arch": "arch64"}}').needs.calc_matrix.outputs.target }}.arch + echo Run x86 + + - if: ${{ contains(needs.calc_matrix.outputs.target, 'host_aarch64') }} + run: | + echo Run aarch64 + + - if: ${{ contains(needs.calc_matrix.outputs.target, 'host_riscv64') }} + run: | + echo Run riscv64 + + # job2: + # # needs: job1 + # runs-on: ubuntu-latest + # strategy: + # matrix: + # target: [x64, aarch64] + # wibble: ${{ fromJSON(needs.job1.outputs.matrix_include) }} + #'[{\"os_flags\": \"wibble\"},{\"os_flags\": \"wibble_x64\", \"target\": \"x64\"}]') }} + # - os_flags: wibble + # - os_flags: wibble_x64 + # target: x64 #${{fromJson('[{"os_flags":"wibble"},{"os_flags":"bar","targets":"x64"}]')}} # {\"include\":[{\"project\":\"foo\",\"config\":\"Debug\"},{\"project\":\"bar\",\"config\":\"Release\"}]} # {\"include\":[{\"project\":\"foo\",\"config\":\"Debug\"},{\"project\":\"bar\",\"config\":\"Release\"}]} # needs.job1.outputs.matrix_include)}} # targets: ["x64","aarch64", "riscv64"] # include: ${{toJSON(needs.job1.outputs.matrix_include)}} - steps: - - run: | - echo ${{ toJSON(matrix.targets) }} - echo ${{ toJson(matrix.include) }} - echo target=${{ matrix.targets }} - echo os_flags=${{ matrix.os_flags }} + # steps: + # - run: | + # # echo ${{ toJSON(matrix.target) }} + # echo ${{ toJson(matrix) }} + # echo target=${{ matrix.target }} + # echo os_flags=${{ matrix.os_flags }} # calc_matrix: # runs-on: ubuntu-latest diff --git a/.github/workflows/workflow_callee.yml b/.github/workflows/workflow_callee.yml deleted file mode 100644 index 790fbc7..0000000 --- a/.github/workflows/workflow_callee.yml +++ /dev/null @@ -1,40 +0,0 @@ -on: - workflow_call: - inputs: - arch_list: - required: true - type: string - workflow_dispatch: - inputs: - llvm_version: - required: true - type: string - update_cache: - required: true - type: boolean - # pull_request: - # paths: - # - '.github/workflows/workflow_callee.yml' - -# env: -# LLVM_VERSION: 17 -# UPDATE_CACHE: false -# jobs: -# # affected-apps: -# # runs-on: ubuntu-latest -# # name: A job to say hello -# # outputs: -# # apps: ${{ steps.step1.outputs.test}} -# # steps: -# # - uses: actions/checkout@v3 -# # - id: step1 -# # run: echo "test=$arch_list" >> "$GITHUB_OUTPUT" -# example_matrix: -# runs-on: ubuntu-latest -# # needs: affected-apps -# strategy: -# matrix: -# app: ${{ fromJson(${{ inputs.arch_list }}) }} -# steps: -# - uses: actions/setup-node@v3 -# - run: echo "${{ matrix.app }}" From 9539f1e1ebe3290db82c8f46e63f7be5a405eb8d Mon Sep 17 00:00:00 2001 From: Colin Davidson Date: Thu, 28 Nov 2024 16:01:54 +0000 Subject: [PATCH 6/6] TBD --- .github/actions/wibble/action.yml | 16 ++++ .github/workflows/workflow1.yml | 145 +++++++++++++++++++----------- hello.c | 5 ++ 3 files changed, 115 insertions(+), 51 deletions(-) create mode 100644 .github/actions/wibble/action.yml create mode 100644 hello.c diff --git a/.github/actions/wibble/action.yml b/.github/actions/wibble/action.yml new file mode 100644 index 0000000..0143252 --- /dev/null +++ b/.github/actions/wibble/action.yml @@ -0,0 +1,16 @@ +name: wibble +description: wibble + +runs: + using: "composite" + steps: + - shell: bash + run: + mkdir foo; + mkdir foo/jim; + cd foo/jim; + pwd + + - shell: bash + run: + pwd diff --git a/.github/workflows/workflow1.yml b/.github/workflows/workflow1.yml index 83547af..7d67c29 100644 --- a/.github/workflows/workflow1.yml +++ b/.github/workflows/workflow1.yml @@ -1,39 +1,82 @@ on: pull_request: + push: + branches: + - main -env: - target_list: '["x64","aarch64", "riscv64"]' - os_list: '["ubuntu-22.04", "windows-2019"]' +# env: +# target_list: '["x64","aarch64", "riscv64"]' +# os_list: '["ubuntu-22.04", "windows-2019"]' jobs: + job1: + permissions: + actions: write + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4.1.0 + - name: delete cache + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh cache delete ccache-ccache-build-wibble-2025-02-18T17:39:18.983Z + + # - name: Setup ccache + # uses: hendrikmuhs/ccache-action@53911442209d5c18de8a31615e0923161e435875 # v1.2.16 + # with: + # max-size: 200M + # key: ccache-build-wibble + # variant: ccache + # save: true + # - name: build + # run: | + # /usr/lib/ccache/gcc hello.c -c -o hello1 + # /usr/lib/ccache/gcc hello.c -c -o hello2 + # /usr/lib/ccache/gcc hello.c -c -o hello3 + # /usr/lib/ccache/gcc hello.c -c -o hello4 + # /usr/lib/ccache/gcc hello.c -c -o hello5 + # /usr/lib/ccache/gcc hello.c -c -o hello6 + # /usr/lib/ccache/gcc hello.c -c -o hello7 + # /usr/lib/ccache/gcc hello.c -c -o hello8 + # ccache -s + + + # job1: # runs-on: ubuntu-latest # outputs: - # matrix: ${{ steps.set-matrix.outputs.matrix_include }} + # matrix: ${{ steps.myid.outputs.matrix }} # steps: - # - id: set-matrix + # - id: myid # run: | # # echo "matrix_include=[{\"os_flags\": \"wibble\"},{\"os_flags\": \"wibble_x64\", \"target\": \"x64\"}]" >> $GITHUB_OUTPUT - # echo 'matrix_include=["os_flags", "wibble"]' >> $GITHUB_OUTPUT + # echo 'matrix="aarch64"' >> $GITHUB_OUTPUT # cat $GITHUB_OUTPUT + # - if: steps.myid.output.matrix == 'aarch64' + # run: + # echo is aarch64 + # - if: steps.myid.output.matrix != 'aarch64' + # run: + # echo is NOT aarch64 - calc_matrix: - runs-on: ubuntu-latest - name: Calc matrix - outputs: - target: ${{ steps.step1.outputs.target }} - # matrix_include: ${{ steps.step1.outputs.matrix_include }} - steps: - - id: step1 - run: | - # # python ./github/scripts/update_vars.py >> "$GITHUB_OUTPUT" - # # echo "target_list=$target_list" >> "$GITHUB_OUTPUT" - # # echo "os_list=$os_list" >> "$GITHUB_OUTPUT" - # echo 'target=["x86", "aarch64"]' >> "$GITHUB_OUTPUT" - # # echo 'os_list=["os_flags", "wibble"]' >> "$GITHUB_OUTPUT" - # # echo 'matrix_include=[{"os_flags": "wibble"},{"os_flags": "wibble_x64", "target": "x86"}]' >> $GITHUB_OUTPUT - echo 'target=[ "host_x86", "host_aarch64"]' >> $GITHUB_OUTPUT - cat $GITHUB_OUTPUT + # calc_matrix: + # runs-on: ubuntu-latest + # name: Calc matrix + # outputs: + # target: ${{ steps.step1.outputs.target }} + # # matrix_include: ${{ steps.step1.outputs.matrix_include }} + # steps: + # - id: step1 + # run: | + # # # python ./github/scripts/update_vars.py >> "$GITHUB_OUTPUT" + # # # echo "target_list=$target_list" >> "$GITHUB_OUTPUT" + # # # echo "os_list=$os_list" >> "$GITHUB_OUTPUT" + # # echo 'target=["x86", "aarch64"]' >> "$GITHUB_OUTPUT" + # # # echo 'os_list=["os_flags", "wibble"]' >> "$GITHUB_OUTPUT" + # # # echo 'matrix_include=[{"os_flags": "wibble"},{"os_flags": "wibble_x64", "target": "x86"}]' >> $GITHUB_OUTPUT + # echo 'target=[ "host_x86", "host_aarch64"]' >> $GITHUB_OUTPUT + # cat $GITHUB_OUTPUT # create_ock_artefacts: # # needs: calc_matrix @@ -51,34 +94,34 @@ jobs: # # - os: windows-2019 # # - target: riscv64 # # - target: aarch64 - create_ock_artefacts: - runs-on: ubuntu-latest - needs: calc_matrix - steps: - # - name: Checkout repo - # uses: actions/checkout@v4.1.0 - # - id: calc_vars2 - # uses: ./.github/actions/calc_vars - # with: - # target: ${{ matrix.target }} - # - id: calc_vars - # run: - # echo "arch=aarch64" >> $GITHUB_OUTPUT - - if: ${{ contains(needs.calc_matrix.outputs.target, 'host_x86') }} - run: | - # echo target=${{ matrix.target }} - # echo arch=${{ steps.calc_vars2.outputs.arch }} - # echo arch=${{ steps.calc_vars.outputs.arch }} - # echo arch=${{ fromJson('{"host_x86":{"arch": "x86_64"},"host_aarch64":{"arch": "arch64"}}').needs.calc_matrix.outputs.target }}.arch - echo Run x86 - - - if: ${{ contains(needs.calc_matrix.outputs.target, 'host_aarch64') }} - run: | - echo Run aarch64 - - - if: ${{ contains(needs.calc_matrix.outputs.target, 'host_riscv64') }} - run: | - echo Run riscv64 + # create_ock_artefacts: + # runs-on: ubuntu-latest + # needs: calc_matrix + # steps: + # # - name: Checkout repo + # # uses: actions/checkout@v4.1.0 + # # - id: calc_vars2 + # # uses: ./.github/actions/calc_vars + # # with: + # # target: ${{ matrix.target }} + # # - id: calc_vars + # # run: + # # echo "arch=aarch64" >> $GITHUB_OUTPUT + # - if: ${{ contains(needs.calc_matrix.outputs.target, 'host_x86') }} + # run: | + # # echo target=${{ matrix.target }} + # # echo arch=${{ steps.calc_vars2.outputs.arch }} + # # echo arch=${{ steps.calc_vars.outputs.arch }} + # # echo arch=${{ fromJson('{"host_x86":{"arch": "x86_64"},"host_aarch64":{"arch": "arch64"}}').needs.calc_matrix.outputs.target }}.arch + # echo Run x86 + + # - if: ${{ contains(needs.calc_matrix.outputs.target, 'host_aarch64') }} + # run: | + # echo Run aarch64 + + # - if: ${{ contains(needs.calc_matrix.outputs.target, 'host_riscv64') }} + # run: | + # echo Run riscv64 # job2: # # needs: job1 diff --git a/hello.c b/hello.c new file mode 100644 index 0000000..ad7cc9f --- /dev/null +++ b/hello.c @@ -0,0 +1,5 @@ +#include + +int main() { + printf("Hello World\n"); +} \ No newline at end of file