diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build.yaml similarity index 62% rename from .github/workflows/build-test.yaml rename to .github/workflows/build.yaml index e93c89f51e..174184f5ef 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build.yaml @@ -1,4 +1,4 @@ -name: Build & Test +name: Build on: push: @@ -9,7 +9,7 @@ on: - master jobs: - build: + backend: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -28,12 +28,23 @@ jobs: - name: Build helloworld binary run: GOOS=linux GOARCH=amd64 go build -o ./.artifacts/helloworld ./cmd/helloworld - test: + frontend: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/setup-node@v2 with: - go-version: '1.17.6' - - name: Run unit tests - run: go test ./pkg/... ./cmd/... + node-version: '16.13.0' + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v2 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Build static assets + run: echo "WIP" diff --git a/.github/workflows/validate-generated-code.yaml b/.github/workflows/codegen.yaml similarity index 91% rename from .github/workflows/validate-generated-code.yaml rename to .github/workflows/codegen.yaml index 11fe864299..23551c2a8c 100644 --- a/.github/workflows/validate-generated-code.yaml +++ b/.github/workflows/codegen.yaml @@ -1,4 +1,4 @@ -name: "Validate Generated Code" +name: CodeGen on: pull_request: @@ -6,7 +6,7 @@ on: jobs: analyze: - name: Analyze + name: validate runs-on: ubuntu-latest steps: - name: Checkout repository diff --git a/.github/workflows/codeql-analysis.yaml b/.github/workflows/codeql-analysis.yaml index 492347e9e0..79987ac834 100644 --- a/.github/workflows/codeql-analysis.yaml +++ b/.github/workflows/codeql-analysis.yaml @@ -1,15 +1,4 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" +name: CodeQL on: # push: @@ -22,7 +11,6 @@ on: jobs: analyze: - name: Analyze runs-on: ubuntu-latest strategy: diff --git a/.github/workflows/publish-artifacts.yaml b/.github/workflows/publish.yaml similarity index 98% rename from .github/workflows/publish-artifacts.yaml rename to .github/workflows/publish.yaml index 549a562328..98f8473ea1 100644 --- a/.github/workflows/publish-artifacts.yaml +++ b/.github/workflows/publish.yaml @@ -1,4 +1,4 @@ -name: Publish Artifacts +name: Publish on: push: @@ -9,7 +9,7 @@ env: REGISTRY: ghcr.io jobs: - publish-image: + image: runs-on: ubuntu-latest permissions: contents: read diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000000..d4ccb18f6a --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,46 @@ +name: Test + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + backend: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: '1.17.6' + - name: Run unit tests + run: go test ./pkg/... ./cmd/... + + frontend: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '16.13.0' + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v2 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Yarn install + working-directory: pkg/app/web + run: yarn install + - name: Run unit tests + working-directory: pkg/app/web + run: echo "WIP"