Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

Commit

Permalink
ci: Switch to GitHub Actions
Browse files Browse the repository at this point in the history
Signed-off-by: Rolson Quadras <rolson.quadras@securekey.com>
  • Loading branch information
rolsonquadras committed Mar 8, 2022
1 parent 857f314 commit f9aba16
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 95 deletions.
94 changes: 94 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#
# Copyright SecureKey Technologies Inc. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#

name: "hub-auth ci"

env:
GO_VERSION: 1.17

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
Checks:
runs-on: ubuntu-20.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Run checks
run: |
echo $PATH
go env
echo ${{ github.workspace }}
make checks
UnitTest:
runs-on: ubuntu-20.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Run unit test
run: make unit-test
- name: Upload coverage to Codecov
run: |
bash <(curl https://codecov.io/bash)
env:
CODECOV_UPLOAD_TOKEN: ${{ secrets.CODECOV_UPLOAD_TOKEN }}

BDDTest:
runs-on: ubuntu-20.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Run BDD test
run: |
make bdd-test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Publish:
needs: [Checks, UnitTest, BDDTest]
if: github.event_name == 'push' && (github.repository == 'trustbloc/hub-auth' && github.ref == 'refs/heads/main')
runs-on: ubuntu-20.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}

- run: |
function logout {
docker logout
}
trap logout EXIT
git lfs install
git lfs pull
source ci/version_var.sh
echo $DOCKER_PASSWORD | docker login ghcr.io --username $DOCKER_USER --password-stdin
make hub-auth-docker
docker tag ghcr.io/trustbloc/hub-auth:latest ${HUB_AUTH_PKG}:${HUB_AUTH_TAG}
docker push ${HUB_AUTH_PKG}:${HUB_AUTH_TAG}
env:
DOCKER_USER: ${{ secrets.CR_USER }}
DOCKER_PASSWORD: ${{ secrets.CR_PAT }}
17 changes: 0 additions & 17 deletions ci/azp-dependencies.yml

This file was deleted.

78 changes: 0 additions & 78 deletions ci/azure-pipelines.yml

This file was deleted.

0 comments on commit f9aba16

Please sign in to comment.