Skip to content

[build system] build test case when TEST_CASE_DIR is unset #868

[build system] build test case when TEST_CASE_DIR is unset

[build system] build test case when TEST_CASE_DIR is unset #868

Workflow file for this run

name: PR
on: [pull_request]
env:
USER: runner
jobs:
gen-matrix:
name: Generate test matrix
runs-on: [self-hosted, linux]
env:
RUNNERS: 16
outputs:
ci-tests: ${{ steps.ci-tests.outputs.matrix }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- run: sudo -E .github/setup-actions.sh
env:
AWS_CREDENTIALS: ${{secrets.AWS_CREDENTIALS}}
CACHE_PRIV_KEY: ${{secrets.CACHE_PRIV_KEY}}
CACHE_DOMAIN: ${{secrets.CACHE_DOMAIN}}
ROCKETCHIP_NIX_REMOTE_SSH_PRIVKEY: ${{secrets.ROCKETCHIP_NIX_REMOTE_SSH_PRIVKEY}}
ROCKETCHIP_NIX_REMOTE_HOST: ${{secrets.ROCKETCHIP_NIX_REMOTE_HOST}}
- uses: cachix/install-nix-action@v19
with:
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
post-build-hook = /etc/nix/upload-to-cache.sh
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= minio.inner.fi.c-3.moe:gDg5SOIH65O0tTV89dUawME5BTmduWWaA7as/cqvevM=
extra-substituters = https://${{secrets.CACHE_DOMAIN}}/nix
sandbox = relaxed
max-jobs = 0
builders = ssh://nix-remote@${{secrets.ROCKETCHIP_NIX_REMOTE_HOST}}?ssh-key=/etc/nix/builder-key
builders-use-substitutes = true
- id: ci-tests
run: nix develop .#testcase -c make ci-passed-tests DEFAULT_PASSED=.github/passed/default.txt
ci:
name: "CI"
needs: [gen-matrix]
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.gen-matrix.outputs.ci-tests) }}
runs-on: [self-hosted, linux]
outputs:
result: ${{ steps.ci-run.outputs.result }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- run: sudo -E .github/setup-actions.sh
env:
AWS_CREDENTIALS: ${{secrets.AWS_CREDENTIALS}}
CACHE_PRIV_KEY: ${{secrets.CACHE_PRIV_KEY}}
CACHE_DOMAIN: ${{secrets.CACHE_DOMAIN}}
ROCKETCHIP_NIX_REMOTE_SSH_PRIVKEY: ${{secrets.ROCKETCHIP_NIX_REMOTE_SSH_PRIVKEY}}
ROCKETCHIP_NIX_REMOTE_HOST: ${{secrets.ROCKETCHIP_NIX_REMOTE_HOST}}
- uses: cachix/install-nix-action@v19
with:
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
post-build-hook = /etc/nix/upload-to-cache.sh
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= minio.inner.fi.c-3.moe:gDg5SOIH65O0tTV89dUawME5BTmduWWaA7as/cqvevM=
extra-substituters = https://${{secrets.CACHE_DOMAIN}}/nix
sandbox = relaxed
max-jobs = 0
builders = ssh://nix-remote@${{secrets.ROCKETCHIP_NIX_REMOTE_HOST}}?ssh-key=/etc/nix/builder-key
builders-use-substitutes = true
- id: ci-run
run: |
nix develop .#testcase -c make ci-run "NAME=${{ matrix.name }}"
- uses: actions/upload-artifact@v3
if: always()
with:
name: results
path: |
test-log/**/fail-test-*.md
test-log/result-*
- uses: actions/upload-artifact@v3
if: failure()
with:
name: fail-log
path: ./test-log/fail/*
- uses: actions/upload-artifact@v3
if: always()
with:
name: nix-post-build-hook-log
path: /tmp/nix-post-build-hook.log
report:
name: "Report CI result"
if: always()
needs: [ci]
runs-on: [self-hosted, linux]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- uses: cachix/install-nix-action@v19
with:
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
nix_path: nixpkgs=channel:nixos-unstable
- uses: actions/download-artifact@v3
with:
name: results
- run: |
echo -e "\n## Fail tests\n" >> $GITHUB_STEP_SUMMARY
find . -name 'fail-test-*.md' -exec bash -c 'cat {} >> $GITHUB_STEP_SUMMARY' \;
- run: |
echo -e "\n## Cycle update\n" >> $GITHUB_STEP_SUMMARY
find . -name 'result.md' -exec bash -c 'cat {} >> $GITHUB_STEP_SUMMARY' \;
- run: |
nix-shell -p ammonite --run 'amm .github/scripts/ci.sc mergeCycleData .'
git config user.name github-actions
git config user.email [email protected]
git diff -s --exit-code '.github/passed/**/passed.json' \
|| (git add '.github/passed/**/passed.json' \
&& git commit -m "[ci] update test case cycle data" \
&& git push origin ${{ github.head_ref }})