Skip to content

Commit

Permalink
.github: add initial github action for CI
Browse files Browse the repository at this point in the history
Goal is to switch current builder run internally by Google over to
GitHub Actions.
  • Loading branch information
ericchiang committed Sep 1, 2021
1 parent 5410759 commit 5b3aa87
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,35 @@
on: [push, pull_request]
name: Test
jobs:
test:
strategy:
matrix:
go-version: [1.16.x, 1.17.x]
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Install libtspi
run: sudo apt-get install -y libtspi-dev
- name: Test
run: go test ./...
test-tpm-12:
strategy:
matrix:
go-version: [1.16.x, 1.17.x]
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Install libtspi
run: sudo apt-get install -y libtspi-dev
- name: Test
run: ./ci/run.sh
15 changes: 15 additions & 0 deletions ci/run.sh
@@ -0,0 +1,15 @@
#!/bin/bash -e

export PROJECT_ROOT="$( pwd )"
TMPDIR="$( mktemp -d )"
SIM_DIR="${TMPDIR}/tpm12_sim"

TEST_ROOT="${TMPDIR}/tests_base"

mkdir -pv "${SIM_DIR}"
./ci/setup_tpm12_simulator.sh "${SIM_DIR}"
./ci/setup_tests_fs.sh "${TEST_ROOT}"

go test -v ./... -- --testTPM12

./ci/shutdown_tpm12_simulator.sh "${SIM_DIR}"

0 comments on commit 5b3aa87

Please sign in to comment.