From be0af3bf0d7ba58834c52411c8cc6344d0dbd94f Mon Sep 17 00:00:00 2001 From: mark wu Date: Tue, 12 Dec 2023 14:39:18 +0800 Subject: [PATCH] Add test workflow on github action --- .github/workflows/test.yaml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..93e2820 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,31 @@ +name: Test + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - uses: actions/setup-go@v4 + with: + go-version: stable + - name: Setup local storages + run: | + mkdir -p data.local/ + mkdir -p data.local/storage + echo "TEST_PAGESHIP_DATABASE_URL=sqlite:///${PWD}/data.local/test_data.db" >> "$GITHUB_ENV" + echo "TEST_PAGESHIP_STORAGE_URL=file:///${PWD}/data.local/storage" >> "$GITHUB_ENV" + - name: Test + run: go test ./... + env: + TEST_PAGESHIP_HOST_PATTERN: http://*.localtest.me + TEST_PAGESHIP_STORAGE_KEY_PREFIX: pageship/ +