From 80dfbbe9d5f616788d7381d3ead386c28db54987 Mon Sep 17 00:00:00 2001 From: Justin Clift Date: Thu, 25 Jan 2024 20:44:41 +1000 Subject: [PATCH] WIP. Initial CI workflow for automatically testing dio --- .github/workflows/ci.yml | 53 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f82b2ea --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,53 @@ +name: Docker Image CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + + - name: Install NodeJS 20 + uses: actions/setup-node@v4 + with: + node-version: 20 + + # Build and start the DBHub.io server daemons + - name: Checkout the DBHub.io source code + uses: actions/checkout@v4 + with: + repository: 'sqlitebrowser/dbhub.io' + path: daemons + + - name: Build the DBHub.io daemons + run: cd daemons; yarn docker:build + + - name: Update the daemon config file + run: cd daemons; sed -i 's/bind_address = ":9443"/bind_address = "0.0.0.0:9443"/' docker/config.toml + + - name: Start the DBHub.io daemons + run: cd daemons; docker run -itd --rm --name dbhub-build --net host dbhub-build:latest && sleep 5 + + # Build and test dio + - name: Checkout dio source code + uses: actions/checkout@v4 + with: + path: main + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.21' + + - name: Build dio + run: cd main; go build -v + + - name: Test dio + run: cd main; go test -v