From 41d19e7910d36611dcebda1b5c1986d0e257ef36 Mon Sep 17 00:00:00 2001 From: Yunkon Kim Date: Tue, 7 May 2024 15:52:32 +0900 Subject: [PATCH] Update GitHub Actions for CI and CD --- .github/workflows/continuous-delivery.yaml | 18 ++++---- .github/workflows/continuous-integration.yaml | 42 +++++++++---------- cmd/cm-beetle/Makefile | 2 +- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/.github/workflows/continuous-delivery.yaml b/.github/workflows/continuous-delivery.yaml index 1b6ec81..aaa7fc0 100644 --- a/.github/workflows/continuous-delivery.yaml +++ b/.github/workflows/continuous-delivery.yaml @@ -18,17 +18,17 @@ on: # Only trigger on semver shaped tags. - "v*.*.*" paths-ignore: - - '.github/**' - - 'docs/**' - - 'scripts/**' - - '**.md' - - '.gitignore' - - 'LICENSE' - - 'CODEOWNERS' + - ".github/**" + - "docs/**" + - "scripts/**" + - "**.md" + - ".gitignore" + - "LICENSE" + - "CODEOWNERS" # - '.all-contributorsrc' # - 'assets/**' # - 'src/testclient/scripts/**' - # workflow trigger button + # workflow trigger button # workflow_dispatch: env: @@ -42,7 +42,7 @@ jobs: # Job name is "Publish a container image" name: Publish a container image - if: github.repository == 'cloud-barista/cm-beetle' + if: github.repository_owner == 'cloud-barista' # This job runs on Ubuntu-latest (Ubuntu 22.04 LTS checked on 2023-12-13) # See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index 6206d55..5409980 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -8,15 +8,15 @@ on: branches: - main paths-ignore: - - '**.md' - - '.all-contributorsrc' - - '.gitignore' - - 'LICENSE' - - 'CODEOWNERS' - - 'assets/**' - - 'scripts/**' - - 'src/testclient/scripts/**' - - 'docs/**' + - "**.md" + - ".all-contributorsrc" + - ".gitignore" + - "LICENSE" + - "CODEOWNERS" + - "assets/**" + - "scripts/**" + - "src/testclient/scripts/**" + - "docs/**" jobs: # The job key (i.e., ID) is "build-source-code" @@ -26,24 +26,24 @@ jobs: # See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners name: Build source code strategy: - matrix: + matrix: go-version: ["1.21"] os: [ubuntu-22.04] - #os: [ubuntu-22.04, ubuntu-20.04, windows-2022, windows-2019] + #os: [ubuntu-22.04, ubuntu-20.04, windows-2022, windows-2019] runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: ${{matrix.go-version}} + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{matrix.go-version}} - - name: Build - run: go build -v ./... + - name: Build + run: make # cd cmd/cm-beetle && go build -v -o cm-beetle - # - name: Test - # run: go test -v ./... + # - name: Test + # run: go test -v ./... # The job key is "build-container-image" build-container-image: @@ -59,7 +59,7 @@ jobs: - name: Checkout source code uses: actions/checkout@v4 - - name: Build + - name: Build env: IMAGE_NAME: ${{ github.event.repository.name }} run: docker build . --file Dockerfile --tag $IMAGE_NAME diff --git a/cmd/cm-beetle/Makefile b/cmd/cm-beetle/Makefile index a061a2e..acd629c 100644 --- a/cmd/cm-beetle/Makefile +++ b/cmd/cm-beetle/Makefile @@ -1,5 +1,5 @@ default: - go build -o cm-beetle + go build -v -o cm-beetle cc: GOOS=linux GOARCH=arm go build -o cm-beetle-arm run: