diff --git a/.github/workflows/build-and-run.yml b/.github/workflows/build-and-run.yml index 43696cb..cb9b865 100644 --- a/.github/workflows/build-and-run.yml +++ b/.github/workflows/build-and-run.yml @@ -90,6 +90,8 @@ jobs: run: | docker load --input /tmp/${{ needs.build-docker-image.outputs.artifact }}.tar docker run --rm ${{ needs.prepare.outputs.imgname }} | tee ${{ steps.vars.outputs.filepath }} + env: + REPEAT: ${{ inputs.run-repeat }} - uses: actions/upload-artifact@v3 with: name: ${{ steps.vars.outputs.artifact }} diff --git a/.github/workflows/ci-dispatch.yml b/.github/workflows/ci-dispatch.yml new file mode 100644 index 0000000..42647f2 --- /dev/null +++ b/.github/workflows/ci-dispatch.yml @@ -0,0 +1,21 @@ +name: "CI for Dispatch Workflows" + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +on: + push: + tags: [ "v[0-9]+.[0-9]+.[0-9]+*" ] + branches: + - "dev/workflow*" + +jobs: + wasmedge-latest: + uses: ./.github/workflows/wasmedge-latest.yml + + wasmedge-tags: + uses: ./.github/workflows/wasmedge-tags.yml + with: + version: "0.12.1" + repeat: 1 diff --git a/.github/workflows/wasmedge-latest.yml b/.github/workflows/wasmedge-latest.yml index 2ca1000..54b9300 100644 --- a/.github/workflows/wasmedge-latest.yml +++ b/.github/workflows/wasmedge-latest.yml @@ -1,16 +1,14 @@ name: "WasmEdge Latest" concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + group: WasmEdge-Latest-${{ github.head_ref || github.ref }}-${{ github.event_name }} cancel-in-progress: true on: schedule: - cron: "7 21 * * *" - push: - tags: [ "v[0-9]+.[0-9]+.[0-9]+*" ] - branches: - - "dev/workflow*" + workflow_call: + workflow_dispatch: jobs: prepare: diff --git a/.github/workflows/wasmedge-tags.yml b/.github/workflows/wasmedge-tags.yml new file mode 100644 index 0000000..b562971 --- /dev/null +++ b/.github/workflows/wasmedge-tags.yml @@ -0,0 +1,63 @@ +name: "WasmEdge Tags" + +concurrency: + group: WasmEdge-Tags-${{ github.head_ref || github.ref }}-${{ github.event_name }} + cancel-in-progress: true + +on: + workflow_dispatch: + inputs: + version: + type: string + required: true + repeat: + type: number + default: 7 + workflow_call: + inputs: + version: + type: string + required: true + repeat: + type: number + default: 7 + +jobs: + precheck: + runs-on: ubuntu-latest + steps: + - run: | + echo 'TODO: check if version is valid' + echo 'TODO: check the event that triggered this workflow,' + echo 'TODO: and assign names for different events' + + wasmedge-release: + needs: [ precheck ] + uses: ./.github/workflows/build-and-run.yml + with: + name: WasmEdge + version: ${{ inputs.version }} + dockerfile: ./docker/wasmedge.Dockerfile + build-args: version=${{ inputs.version }} + run-repeat: ${{ inputs.repeat }} + + upload: + needs: [ wasmedge-release ] + uses: ./.github/workflows/upload.yml + with: + name: WasmEdge + version: ${{ inputs.version }} + artifact: ${{ needs.wasmedge-release.outputs.artifact }} + + summarize: + needs: [ wasmedge-release ] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 + with: + name: ${{ needs.wasmedge-release.outputs.artifact }} + path: ./result + - run: | + echo 'TODO: print a summary' + jq '."libsodium-tests".repeat' < ./result/${{ needs.wasmedge-release.outputs.filename }}