Skip to content

Commit

Permalink
Update GitHub Actions
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
  • Loading branch information
alexellis committed Feb 22, 2023
1 parent 7741589 commit d2d2d10
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: Build-Test
strategy:
matrix:
go-version: [1.15.x]
go-version: [1.18.x]
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}
Expand Down
74 changes: 33 additions & 41 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,59 +7,51 @@ on:

jobs:

build-test:
name: Build-Test
strategy:
matrix:
go-version: [1.15.x]
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}

steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: build
run: make build
- name: Test
run: make test

publish-derek:
permissions:
actions: read
checks: write
contents: read
issues: read
packages: write
pull-requests: read
repository-projects: read
statuses: read
runs-on: ubuntu-latest
needs: build-test
steps:
- uses: actions/checkout@master
with:
fetch-depth: 1
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Get Repo Owner
id: get_repo_owner
run: echo ::set-output name=repo_owner::$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')

- name: Get TAG
id: get_tag
run: echo ::set-output name=TAG::${GITHUB_REF#refs/tags/}
- name: Login to GHCR Registry
uses: docker/login-action@v1
run: echo TAG=${GITHUB_REF#refs/tags/} >> $GITHUB_ENV
- name: Get Repo Owner
id: get_repo_owner
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" > $GITHUB_ENV

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to container Registry
uses: docker/login-action@v2
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKER_PASSWORD }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
- name: Build and push
uses: docker/build-push-action@v2

- name: Release build
id: release_build
uses: docker/build-push-action@v3
with:
context: .
outputs: "type=registry,push=true"
platforms: linux/amd64,linux/arm64
push: true
build-args: |
Version=${{ env.TAG }}
GitCommit=${{ github.sha }}
tags: |
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/derek:${{ steps.get_tag.outputs.TAG }}
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/derek:${{ github.sha }}
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/derek:latest
ghcr.io/${{ env.REPO_OWNER }}/derek:${{ github.sha }}
ghcr.io/${{ env.REPO_OWNER }}/derek:${{ env.TAG }}
ghcr.io/${{ env.REPO_OWNER }}/derek:latest
5 changes: 2 additions & 3 deletions handler/comment_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package handler

import (
"log"
"os"
"strings"
"testing"
Expand All @@ -14,7 +13,7 @@ import (
)

func Test_fixCommitsMessage(t *testing.T) {
log.Println(fixCommits)
t.Log(fixCommits)
}

func Test_getCommandTrigger(t *testing.T) {
Expand Down Expand Up @@ -770,7 +769,7 @@ func Test_getCommandValue(t *testing.T) {
expectedVal: "burt",
},
{
title: "Single Label trailing mixure",
title: "Single Label trailing mixure",
commentBody: "Derek add label: burt,,. , ,, ,.,",
trigger: "Derek add label: ",
expectedVal: "burt",
Expand Down

0 comments on commit d2d2d10

Please sign in to comment.