Skip to content

Simulate Dell Smart Card Reader Keyboard in tests #1387

Simulate Dell Smart Card Reader Keyboard in tests

Simulate Dell Smart Card Reader Keyboard in tests #1387

Workflow file for this run

name: CI
on:
# Run CI on every commit to the "main" branch.
push:
branches: [ main ]
# Run CI on every PR.
pull_request:
# Run CI on the "main" branch every day (to catch random flakiness or CI
# environment regressions).
schedule:
- cron: "0 0 * * *"
env:
# The version of libstdc++ to install for analysis builds.
ANALYSIS_LIBSTDCPP_VERSION: 12
jobs:
# Build and test in WebAssembly mode.
build-emscripten:
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
matrix:
build-config: [Release, Debug]
fail-fast: false
steps:
- name: Check out sources
uses: actions/checkout@v3
- name: Install build dependencies
uses: ./.github/actions/build-dependencies-installation
with:
toolchain: emscripten
- name: Compile
env:
TOOLCHAIN: emscripten
CONFIG: ${{ matrix.build-config }}
run: >
source env/activate && make -j30
- name: Test
env:
TOOLCHAIN: emscripten
CONFIG: ${{ matrix.build-config }}
timeout-minutes: 30
run: >
source env/activate && make test
- name: Upload built app packages
uses: kittaakos/upload-artifact-as-is@v0
with:
path: built_app_packages
- name: Upload example JS standalone smart card client library
uses: actions/upload-artifact@v3
with:
# Suffix the file name with ".debug" for Debug builds.
name: google-smart-card-client-library${{ matrix.build-config == 'Debug' && '.debug' || '' }}.js
path: example_js_standalone_smart_card_client_library/out/example_js_standalone_smart_card_client_library/google-smart-card-client-library.js
- name: Upload example JS standalone smart card client library ES module
uses: actions/upload-artifact@v3
with:
# Suffix the file name with ".debug" for Debug builds.
name: google-smart-card-client-library-es-module${{ matrix.build-config == 'Debug' && '.debug' || '' }}.js
path: example_js_standalone_smart_card_client_library/out/example_js_standalone_smart_card_client_library/google-smart-card-client-library-es-module.js
# Build and test in Native Client mode.
build-nacl:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
build-config: [Release, Debug]
fail-fast: false
steps:
- name: Check out sources
uses: actions/checkout@v3
- name: Install build dependencies
uses: ./.github/actions/build-dependencies-installation
with:
toolchain: pnacl
- name: Compile
env:
TOOLCHAIN: pnacl
CONFIG: ${{ matrix.build-config }}
run: >
source env/activate &&
source env/python2_venv/bin/activate &&
make
- name: Upload built app packages
uses: kittaakos/upload-artifact-as-is@v0
with:
path: built_app_packages
# Run unit tests under ASan.
test-asan:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
matrix:
build-config: [Release, Debug]
fail-fast: false
steps:
- name: Check out sources
uses: actions/checkout@v3
- name: Install build dependencies
uses: ./.github/actions/build-dependencies-installation
with:
toolchain: asan_testing
# When building for analysis, explicitly tell Clang to use the right include
# path, because Clang's heuristics often fail to deduce it automatically.
- name: Compile
env:
CPLUS_INCLUDE_PATH: /usr/i686-linux-gnu/include/c++/${{ env.ANALYSIS_LIBSTDCPP_VERSION }}/i686-linux-gnu/
TOOLCHAIN: asan_testing
CONFIG: ${{ matrix.build-config }}
run: >
source env/activate && make -j30
- name: Test
env:
TOOLCHAIN: asan_testing
CONFIG: ${{ matrix.build-config }}
timeout-minutes: 45
run: >
source env/activate && make test
# Collect code coverage statistics.
collect-coverage:
runs-on: ubuntu-latest
outputs:
LINE_COVERAGE_PERCENT: ${{ steps.build-coverage.outputs.LINE_COVERAGE_PERCENT }}
timeout-minutes: 60
steps:
- name: Check out sources
uses: actions/checkout@v3
- name: Install build dependencies
uses: ./.github/actions/build-dependencies-installation
with:
toolchain: coverage
# When building for analysis, explicitly tell Clang to use the right include
# path, because Clang's heuristics often fail to deduce it automatically.
#
# Set pipefail, so that failures in the coverage runs aren't swallowed.
- name: Build coverage report
id: build-coverage
env:
CPLUS_INCLUDE_PATH: /usr/i686-linux-gnu/include/c++/${{ env.ANALYSIS_LIBSTDCPP_VERSION }}/i686-linux-gnu/
run: >
set -o pipefail &&
(./coverage-report.sh | tee coverage-output.txt) &&
echo "::set-output name=LINE_COVERAGE_PERCENT::$(
scripts/parse-coverage-output.py < coverage-output.txt
)"
- name: Upload coverage report
uses: actions/upload-artifact@v3
with:
name: coverage-report-detailed.zip
path: coverage-report-detailed/
# Post an autogenerated comment on the Pull Request (in case the action is run
# because of one).
post-results-comment:
runs-on: ubuntu-latest
# Depend on all other jobs, so that we don't post a PR comment if any fails.
needs: [build-emscripten, build-nacl, test-asan, collect-coverage]
timeout-minutes: 5
steps:
- name: Comment on pull request
if: github.event.pull_request
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
__Continuous Integration__: All tests passed.
C/C++ test coverage: ${{ needs.collect-coverage.outputs.LINE_COVERAGE_PERCENT }} lines.