diff options
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/compile.yml | 26 | ||||
-rw-r--r-- | .github/workflows/test-results.yml | 51 |
2 files changed, 69 insertions, 8 deletions
diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 48bd305..8ef4ca8 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -6,10 +6,10 @@ jobs: build: runs-on: [ubuntu-18.04] steps: - - name: Install opam2 - run: | - sudo add-apt-repository -y ppa:avsm/ppa - sudo apt install -y opam zlib1g-dev pkg-config libgmp-dev z3 + - name: Add opam2 PPA + run: sudo add-apt-repository -y ppa:avsm/ppa + - name: Install packages + run: sudo apt install -y opam zlib1g-dev pkg-config libgmp-dev z3 device-tree-compiler - name: Init opam run: opam init --disable-sandboxing -y - name: Install sail @@ -18,7 +18,17 @@ jobs: uses: actions/checkout@HEAD with: submodules: true - - name: Build RV32 simulators - run: eval $(opam env) && make ARCH=RV32 -j2 csim rvfi osim - - name: Build RV64 simulators - run: eval $(opam env) && make ARCH=RV64 -j2 csim rvfi osim + - name: Build and test simulators + run: eval $(opam env) && test/run_tests.sh + - name: Upload test results + if: always() + uses: actions/upload-artifact@v2 + with: + name: tests.xml + path: test/tests.xml + - name: Upload event payload + if: always() + uses: actions/upload-artifact@v2 + with: + name: event.json + path: ${{ github.event_path }} diff --git a/.github/workflows/test-results.yml b/.github/workflows/test-results.yml new file mode 100644 index 0000000..65071cd --- /dev/null +++ b/.github/workflows/test-results.yml @@ -0,0 +1,51 @@ +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@v3.1.0 + with: + script: | + var fs = require('fs'); + var artifacts = await github.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.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@v1 + with: + commit: ${{ github.event.workflow_run.head_sha }} + event_file: event.json + event_name: ${{ github.event.workflow_run.event }} + files: tests.xml |