garm/.github/workflows/integration-tests.yml
Gabriel Adrian Samfira d02292bd1a
Fix config dir location
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-08-02 17:29:08 +03:00

65 lines
1.8 KiB
YAML

name: Integration Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
integration-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Golang
uses: actions/setup-go@v3
with:
go-version-file: go.mod
- name: Setup LXD
uses: canonical/setup-lxd@v0.1.1
- name: Build GARM
run: make build
- name: Setup GARM
run: ./test/integration/scripts/setup-garm.sh
env:
GH_OAUTH_TOKEN: ${{ secrets.GH_OAUTH_TOKEN }}
CREDENTIALS_NAME: test-garm-creds
- name: Generate secrets
run: |
function randomStringGenerator() {
tr -dc "a-zA-Z0-9@#$%^&*()_+?><~\`;'" </dev/urandom | head -c 64 ; echo '';
}
echo "GARM_PASSWORD=$(randomStringGenerator)" >> $GITHUB_ENV
echo "REPO_WEBHOOK_SECRET=$(randomStringGenerator)" >> $GITHUB_ENV
echo "ORG_WEBHOOK_SECRET=$(randomStringGenerator)" >> $GITHUB_ENV
- name: Set up ngrok
id: ngrok
uses: gabriel-samfira/ngrok-tunnel-action@867169320326b49398c565de3b3f0ee75fb1599a
with:
ngrok_authtoken: ${{ secrets.NGROK_AUTH_TOKEN }}
port: 9997
tunnel_type: http
- name: Run integration tests
run: go run ./test/integration/e2e.go
env:
GARM_BASE_URL: ${{ steps.ngrok.outputs.tunnel-url }}
GARM_USERNAME: admin
GARM_FULLNAME: Local GARM Admin
GARM_EMAIL: admin@example.com
GARM_NAME: local_garm
CREDENTIALS_NAME: test-garm-creds
- name: Show GARM logs
if: always()
run: |
sudo systemctl status garm
sudo journalctl -u garm --no-pager