remove gh provider #24
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: | |
workflow_call: | |
secrets: | |
AWS_ACCESS_KEY_ID: | |
required: true | |
AWS_SECRET_ACCESS_KEY: | |
required: true | |
GOOGLE_TEST_SERVICE_KEY: | |
required: true | |
GOOGLE_CLOUD_PROJECT: | |
required: true | |
OP_SERVICE_ACCOUNT_TOKEN: | |
required: true | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x, 20.x, 21.x, 22.x, 23.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install KeePassXC | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y keepassxc | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- name: Setup Google Cloud credentials | |
run: | | |
echo '${{ secrets.GOOGLE_TEST_SERVICE_KEY }}' > /tmp/google-credentials.json | |
- name: Set 1Password service account token and install op | |
uses: 1password/load-secrets-action/configure@v2 | |
with: | |
service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} | |
- name: Install op | |
run: | | |
curl -sS https://downloads.1password.com/linux/keys/1password.asc | \ | |
sudo gpg --dearmor --output /usr/share/keyrings/1password-archive-keyring.gpg && \ | |
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/$(dpkg --print-architecture) stable main" | \ | |
sudo tee /etc/apt/sources.list.d/1password.list && \ | |
sudo mkdir -p /etc/debsig/policies/AC2D62742012EA22/ && \ | |
curl -sS https://downloads.1password.com/linux/debian/debsig/1password.pol | \ | |
sudo tee /etc/debsig/policies/AC2D62742012EA22/1password.pol && \ | |
sudo mkdir -p /usr/share/debsig/keyrings/AC2D62742012EA22 && \ | |
curl -sS https://downloads.1password.com/linux/keys/1password.asc | \ | |
sudo gpg --dearmor --output /usr/share/debsig/keyrings/AC2D62742012EA22/debsig.gpg && \ | |
sudo apt update && sudo apt install 1password-cli | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: Run tests | |
env: | |
GOOGLE_APPLICATION_CREDENTIALS: /tmp/google-credentials.json | |
GOOGLE_CLOUD_PROJECT: ${{ secrets.GOOGLE_CLOUD_PROJECT }} | |
AWS_REGION: us-east-1 | |
run: npm test |