Evolve the test driver framework and adopt it into NTC #384
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
build-check: | |
name: "Linux" | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache-Identify | |
id: get-hash | |
run: echo "ntf_deps_hash=`cat .github/workflows/docker/build_deps.sh .github/workflows/docker/build_test_ntf.sh .github/workflows/docker/Dockerfile | shasum`" >> $GITHUB_OUTPUT | |
- name: Cache-Lookup | |
id: cache-restore | |
uses: actions/cache/restore@v3 | |
with: | |
path: ntf_deps_image.tar.gz | |
key: ${{ steps.get-hash.outputs.ntf_deps_hash }} | |
- name: Cache-Build | |
if: steps.cache-restore.outputs.cache-hit != 'true' | |
run: docker build --tag ntf-deps --platform linux/amd64 .github/workflows/docker | |
- name: Cache-Restore | |
if: steps.cache-restore.outputs.cache-hit == 'true' | |
run: docker load < ntf_deps_image.tar.gz | |
- name: Cache-Save | |
if: steps.cache-restore.outputs.cache-hit != 'true' | |
run: docker save ntf-deps:latest | gzip > ntf_deps_image.tar.gz | |
- name: Cache-Commit | |
id: cache-save | |
if: steps.cache-restore.outputs.cache-hit != 'true' | |
uses: actions/cache/save@v3 | |
with: | |
path: ntf_deps_image.tar.gz | |
key: ${{ steps.get-hash.outputs.ntf_deps_hash }} | |
- name: Build | |
id: ntf-deps-run | |
run: docker run -v $(pwd):/workspace/ntf-core --name ntf-deps ntf-deps /bin/bash -c "/workspace/ntf-core/.github/workflows/docker/build_test_ntf.sh" |