diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml deleted file mode 100644 index 865c748a5..000000000 --- a/.github/workflows/compile.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: CI - -on: [push, pull_request, workflow_dispatch] - -jobs: - build: - runs-on: ubuntu-22.04 - steps: - - name: Install packages - run: sudo apt install -y opam zlib1g-dev pkg-config libgmp-dev z3 device-tree-compiler - - name: Check out repository code - uses: actions/checkout@HEAD - with: - submodules: true - - name: Ensure pre-commit checks pass - run: pip install pre-commit && pre-commit run --all-files --show-diff-on-failure --color=always - - name: Init opam - run: opam init --disable-sandboxing -y - - name: Install sail - run: opam install -y sail - - name: Build and test simulators - run: eval $(opam env) && test/run_tests.sh - - name: Upload test results - if: always() - uses: actions/upload-artifact@v4 - with: - name: tests.xml - path: test/tests.xml - - name: Upload event payload - if: always() - uses: actions/upload-artifact@v4 - with: - name: event.json - path: ${{ github.event_path }} diff --git a/.github/workflows/sail-ci.yml b/.github/workflows/sail-ci.yml new file mode 100644 index 000000000..74ad0327b --- /dev/null +++ b/.github/workflows/sail-ci.yml @@ -0,0 +1,60 @@ +name: SAIL CI + +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + runs-on: ubuntu-22.04 + + steps: + - name: Check out repository code + uses: actions/checkout@v4 + with: + submodules: true + + - name: Install dependencies + id: install_dependencies + run: | + sudo apt update + sudo apt install -y opam zlib1g-dev pkg-config libgmp-dev z3 device-tree-compiler + pip install pre-commit + + - name: Ensure pre-commit checks pass + id: pre_commit + run: pre-commit run --all-files --show-diff-on-failure --color=always + + - name: Init opam + id: init_opam + run: opam init --disable-sandboxing -y + + - name: Install sail + id: install_sail + run: opam install -y sail + + - name: Build and test simulators + if: steps.install_dependencies.outcome == 'success' && steps.pre_commit.outcome == 'success' && steps.init_opam.outcome == 'success' && steps.install_sail.outcome == 'success' + id: build_test_simulators + run: eval $(opam env) && test/run_tests.sh + + - name: Upload test.xml + id: upload_test_xml + if: steps.build_test_simulators.outcome == 'success' + uses: actions/upload-artifact@v4 + with: + name: tests.xml + path: test/tests.xml + + - name: Upload event.json + id: upload_event_json + if: steps.build_test_simulators.outcome == 'success' + uses: actions/upload-artifact@v4 + with: + name: event.json + path: ${{ github.event_path }} + + - name: Publish Test Results + if: steps.build_test_simulators.outcome == 'success' + uses: EnricoMi/publish-unit-test-result-action@v2 + with: + files: | + test/tests.xml diff --git a/.github/workflows/test-results.yml b/.github/workflows/test-results.yml deleted file mode 100644 index 4201d46e5..000000000 --- a/.github/workflows/test-results.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Publish test results - -on: - workflow_run: - workflows: ["CI"] - types: - - completed - -jobs: - publish-test-results: - runs-on: ubuntu-latest - if: github.event.workflow_run.conclusion != 'skipped' - steps: - - name: Download artifacts - uses: actions/github-script@v6 - with: - script: | - var fs = require('fs'); - var artifacts = await github.rest.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: ${{github.event.workflow_run.id }}, - }); - var matchArtifacts = artifacts.data.artifacts.filter((artifact) => { - return artifact.name == 'tests.xml' || artifact.name == 'event.json' - }); - var count = matchArtifacts.length; - for (var i = 0; i < count; i++) { - var matchArtifact = matchArtifacts[i]; - var download = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: 'zip', - }); - var name = matchArtifact.name; - var dest = name + '.zip' - fs.writeFileSync('${{github.workspace}}/' + dest, Buffer.from(download.data)); - console.log("Downloaded", name, "as", dest); - } - - name: Extract test results - run: unzip tests.xml.zip - - name: Extract event payload - run: unzip event.json.zip - - name: Publish test results - uses: EnricoMi/publish-unit-test-result-action@v2 - with: - commit: ${{ github.event.workflow_run.head_sha }} - event_file: event.json - event_name: ${{ github.event.workflow_run.event }} - files: tests.xml