diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 8fa7741c0a..9c8ba5c7f7 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -2,6 +2,9 @@ name: "build" description: "Defines the central steps in building ns-3" inputs: + test: + description: "Whether to run tests" + default: "false" save-ccache: description: "Whether to update build ccache after building" default: "true" @@ -30,15 +33,36 @@ runs: - name: "Build ns-3" shell: bash run: ./ns3 build - # Post-build steps - - if: inputs.store-artifacts == 'true' - name: "Tar files to preserve permissions" + # Manage inter-run placeholder for running tests + - name: "Get cache miss rate" + shell: bash + run: | + echo "CACHE_MISS=`./utils/ccache-miss-rate.py`" >> $GITHUB_ENV + touch build/tests-base.txt + - if: env.CACHE_MISS != '0' + name: "Create tests placeholder" shell: bash - run: tar -cf build.tzst --exclude build.tzst -P -C $GITHUB_WORKSPACE --use-compress-program zstdmt build/ .lock-* - - if: inputs.store-artifacts == 'true' - name: "Upload build artifacts" + run: | + touch build/tests-$BUILD_ID.txt + - if: env.CACHE_MISS != '0' + name: "Upload tests placeholder" uses: actions/upload-artifact@v4 with: - name: ${{ env.BUILD_ID }} - path: build.tzst - retention-days: 2 + name: ${{ format('{0}{1}', 'tests-', env.BUILD_ID) }} + path: build/tests-*.txt + retention-days: 90 + # Post-build steps + #- if: inputs.store-artifacts == 'true' + # name: "Tar files to preserve permissions" + # shell: bash + # run: tar -cf build.tzst --exclude build.tzst -P -C $GITHUB_WORKSPACE --use-compress-program zstdmt build/ .lock-* + #- if: inputs.store-artifacts == 'true' + # name: "Upload build artifacts" + # uses: actions/upload-artifact@v4 + # with: + # name: ${{ env.BUILD_ID }} + # path: build.tzst + # retention-days: 2 + - name: "Show ccache stats" + shell: bash + run: ccache -s diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index 77395cb4ff..5acc4c5437 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -4,11 +4,25 @@ description: "Defines the central steps in testing ns-3" runs: using: "composite" steps: - # Test steps - - name: "Store ccache miss rate" + - name: "Download tests placeholder" shell: bash - run: echo "CACHE_MISS=`./utils/ccache-miss-rate.py`" >> $GITHUB_ENV - - if: env.CACHE_MISS != '0' && env.MODE != 'debug' - name: "Test ns-3" + uses: actions/download-artifact@v4 + with: + name: ${{ format('{0}{1}', 'tests-', env.BUILD_ID) }} + path: build + # Test steps + - name: "Test ns-3" shell: bash - run: ./test.py -n + run: > + if [[ "$MODE" != "debug" ]] && [[ -f build/tests-$BUILD_ID.txt ]]; + then ./test.py -n; + if [[ $? == 0 ]]; + then `rm build/tests-$BUILD_ID.txt` || true; + fi; + fi + - name: "Upload tests placeholder" + uses: actions/upload-artifact@v4 + with: + name: ${{ format('{0}{1}', 'tests-', env.BUILD_ID) }} + path: build/tests-*.txt + retention-days: 90 diff --git a/.github/workflows/per-commit.yml b/.github/workflows/per-commit.yml index 2e72ae9ef4..30e7113d35 100644 --- a/.github/workflows/per-commit.yml +++ b/.github/workflows/per-commit.yml @@ -3,17 +3,17 @@ run-name: "per-commit" on: push: - branches: [develop] + branches: [develop, fix-ns-3.41-ci] pull_request: branches: [develop] workflow_dispatch: jobs: - code-formatting: - uses: ./.github/workflows/.formatting.yml + #code-formatting: + # uses: ./.github/workflows/.formatting.yml compile: - needs: code-formatting + #needs: code-formatting runs-on: ubuntu-latest container: image: archlinux @@ -54,10 +54,10 @@ jobs: code-linting: needs: compile - uses: ./.github/workflows/.linting.yml - - documentation: - needs: code-linting + # uses: ./.github/workflows/.linting.yml +# + #documentation: + # needs: code-linting uses: ./.github/workflows/.test-doc.yml code-analysis: @@ -65,9 +65,9 @@ jobs: uses: ./.github/workflows/analysis.yml secrets: inherit - deploy-doc: - # do not run on PR events - if: github.event_name == 'push' - needs: documentation - uses: ./.github/workflows/deploy-doc.yml - secrets: inherit + #deploy-doc: + # # do not run on PR events + # if: github.event_name == 'push' + # needs: documentation + # uses: ./.github/workflows/deploy-doc.yml + # secrets: inherit