Arm support #158
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- '*.*.*' # semver, will override latest | |
- '*-preview' # preview, won't override latest | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: # Allow manual trigger | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- id: nvm | |
run: echo ::set-output name=NVMRC::$(cat .nvmrc) | |
- uses: actions/[email protected] | |
with: | |
node-version: '${{ steps.nvm.outputs.NVMRC }}' | |
cache: yarn | |
- run: yarn install --frozen-lockfile | |
- name: Lint sources | |
run: | | |
make lint | |
yarn lint | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- id: nvm | |
run: echo ::set-output name=NVMRC::$(cat .nvmrc) | |
- uses: actions/[email protected] | |
with: | |
node-version: '${{ steps.nvm.outputs.NVMRC }}' | |
cache: yarn | |
- name: Setup Go environment | |
uses: actions/[email protected] | |
with: | |
go-version: '^1.18.0' | |
- run: yarn install --frozen-lockfile | |
- name: Execute tests | |
run: | | |
make test | |
make test-integration | |
yarn test | |
make coverage | |
- name: SonarCloud Scan | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- id: extract_ref | |
run: echo ::set-output name=GIT_REF::$(echo ${GITHUB_REF##*/}) | |
- id: nvm | |
run: echo ::set-output name=NVMRC::$(cat .nvmrc) | |
- uses: actions/[email protected] | |
with: | |
node-version: '${{ steps.nvm.outputs.NVMRC }}' | |
cache: yarn | |
- name: Setup Go environment | |
uses: actions/[email protected] | |
with: | |
go-version: '^1.18.0' | |
- uses: satackey/[email protected] | |
continue-on-error: true | |
- run: yarn install --frozen-lockfile | |
- name: Build | |
run: | | |
make VERSION=${{ steps.extract_ref.outputs.GIT_REF }} RELEASE=1 release | |
make VERSION=${{ steps.extract_ref.outputs.GIT_REF }} build-docker | |
make VERSION=${{ steps.extract_ref.outputs.GIT_REF }} start-docker | |
- if: startsWith(github.ref, 'refs/tags/') | |
run: make save-docker | |
- if: startsWith(github.ref, 'refs/tags/') | |
uses: actions/[email protected] | |
with: | |
name: smocker-bin | |
path: ./build/smocker.tar.gz | |
- if: startsWith(github.ref, 'refs/tags/') | |
uses: actions/[email protected] | |
with: | |
name: smocker-docker | |
path: /tmp/smocker.tar | |
deploy: | |
needs: [lint, test, build] | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- id: extract_ref | |
run: echo ::set-output name=GIT_REF::$(echo ${GITHUB_REF##*/}) | |
- uses: actions/download-artifact@v2 | |
with: | |
name: smocker-bin | |
path: ./build | |
- uses: actions/download-artifact@v2 | |
with: | |
name: smocker-docker | |
path: /tmp | |
- run: make VERSION=${{ steps.extract_ref.outputs.GIT_REF }} load-docker | |
- name: Docker login | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Deploy on Docker registry | |
run: make VERSION=${{ steps.extract_ref.outputs.GIT_REF }} deploy-docker | |
- name: Deploy on GitHub releases | |
uses: softprops/[email protected] | |
with: | |
files: build/smocker.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} |