Async #292
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: Test Asherah-Node | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
MYSQL_HOSTNAME: mysql | |
MYSQL_DATABASE: testdb | |
MYSQL_USERNAME: root | |
MYSQL_PASSWORD: Password123 | |
jobs: | |
test-package: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql:5.7 | |
env: | |
MYSQL_DATABASE: ${{ env.MYSQL_DATABASE }} | |
MYSQL_ROOT_PASSWORD: ${{ env.MYSQL_PASSWORD }} | |
ports: | |
- 3306:3306 | |
options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 10 | |
container: | |
image: node:bullseye | |
options: --ulimit core=-1 --ulimit memlock=-1:-1 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install npm packages | |
run: npm install | |
- name: Unit Test | |
run: npm test | |
- name: Initialize RDBMS based metastore | |
run: | | |
apt-get update | |
apt-get install default-mysql-client -y | |
mysql -h ${{ env.MYSQL_HOSTNAME }} -P${{ job.services.mysql.ports[3306] }} -u ${{ env.MYSQL_USERNAME }} -p${{ env.MYSQL_PASSWORD }} -e "CREATE TABLE ${{ env.MYSQL_DATABASE }}.encryption_key ( | |
id VARCHAR(255) NOT NULL, | |
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
key_record TEXT NOT NULL, | |
PRIMARY KEY (id, created), | |
INDEX (created) | |
);" | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.20.7 | |
- name: Test Cross-Language | |
env: | |
TEST_DB_NAME: ${{ env.MYSQL_DATABASE }} | |
TEST_DB_PASSWORD: ${{ env.MYSQL_PASSWORD }} | |
TEST_DB_HOSTNAME: ${{ env.MYSQL_HOSTNAME }} | |
TEST_DB_USER: ${{ env.MYSQL_USERNAME }} | |
TEST_DB_PORT: ${{ job.services.mysql.ports[3306] }} | |
ASHERAH_SERVICE_NAME: service | |
ASHERAH_PRODUCT_NAME: product | |
ASHERAH_KMS_MODE: static | |
run: scripts/integration-test.sh | |
- name: Publish (dry-run) | |
run: npm publish --dry-run | |
test-multi-arch: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
arch: [ {tag: arm64v8, platform: linux/arm64/v8} ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Multi-Architecture Support | |
run: scripts/setup-multiarch.sh | |
- name: Test Multi-Architecture | |
run: scripts/test-arch.sh | |
env: | |
TEST_TAG: ${{ matrix.arch.tag }} | |
TEST_PLATFORM: ${{ matrix.arch.platform }} |