diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml deleted file mode 100644 index d85e7d9f..00000000 --- a/.github/workflows/common.yml +++ /dev/null @@ -1,10 +0,0 @@ -on: - workflow_call: -jobs: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 - with: { go-version: 1.17 } - - uses: actions/setup-node@v3 - with: { node-version: '14' } - - name: Install task binary - run: go get github.com/go-task/task/v3/cmd/task \ No newline at end of file diff --git a/.github/workflows/install-go.yml b/.github/workflows/install-go.yml new file mode 100644 index 00000000..c5cb5c83 --- /dev/null +++ b/.github/workflows/install-go.yml @@ -0,0 +1,8 @@ +on: + workflow_call: +jobs: + install_go: + runs-on: [ubuntu-latest] + steps: + - uses: actions/setup-go@v3 + with: { go-version: 1.17 } diff --git a/.github/workflows/install-node.yml b/.github/workflows/install-node.yml new file mode 100644 index 00000000..b3302569 --- /dev/null +++ b/.github/workflows/install-node.yml @@ -0,0 +1,8 @@ +on: + workflow_call: +jobs: + install_node: + runs-on: [ubuntu-latest] + steps: + - uses: actions/setup-node@v3 + with: { node-version: '14' } \ No newline at end of file diff --git a/.github/workflows/install-task-binary.yml b/.github/workflows/install-task-binary.yml new file mode 100644 index 00000000..ebc13b1e --- /dev/null +++ b/.github/workflows/install-task-binary.yml @@ -0,0 +1,7 @@ +on: + workflow_call: +jobs: + install_task_binary: + runs-on: [ubuntu-latest] + steps: + - run: go get github.com/go-task/task/v3/cmd/task \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 79b641ea..fd6b2f9b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,10 @@ jobs: build-local: runs-on: [ubuntu-latest] steps: - - uses: ./.github/workflows/common.yml + - uses: ./.github/workflows/install-go.yml + - uses: ./.github/workflows/install-node.yml + - uses: ./.github/workflows/install-task-binary.yml + - uses: actions/checkout@v3 - run: task deps - run: task compile - uses: ./.github/workflows/test-compile-changes.yml @@ -16,14 +19,49 @@ jobs: build: runs-on: [ubuntu-latest] steps: - - uses: ./.github/workflows/common.yml + - uses: ./.github/workflows/install-go.yml + - uses: ./.github/workflows/install-node.yml + - uses: ./.github/workflows/install-task-binary.yml - run: sudo apt update && sudo apt-get install rpm + - uses: actions/checkout@v3 - run: task deps - run: task compile - uses: ./.github/workflows/test-compile-changes.yml - uses: ./.github/workflows/unlock-gpg.yml - run: task build + test-golang: + runs-on: [ubuntu-latest] + steps: + - uses: ./.github/workflows/install-go.yml + - uses: ./.github/workflows/install-task-binary.yml + - run: go get github.com/schrej/godacov + - uses: actions/checkout@v3 + - run: task deps:tools + - run: task deps:be + - run: task compile:be + - run: task lint:be + - run: task test + - run: godacov -t "${CODACY_TOKEN}" -r ./coverage.out -c "${CIRCLE_SHA1}" || true + + test-integration: + runs-on: [ubuntu-latest] + steps: + - uses: actions/checkout@v3 + - uses: ./.github/workflows/install-task-binary.yml + - run: context=ci task dc:up + + test-db-migration: + steps: + - uses: ./.github/workflows/install-node.yml + - uses: ./.github/workflows/install-task-binary.yml + # TODO: add semaphore binary from previous job + - run: "cat > config.json <