Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to GitHub action from Drone #235

Merged
merged 1 commit into from
Aug 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: For each commit and PR
on:
push:
pull_request:

jobs:
validation:
runs-on: ubuntu-latest
env:
CGO_ENABLED: 0
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: '1.14.6'
- name: go fmt
run: go fmt ./...
- name: go vet
run: go vet ./...
- name: golangci-lint
uses: golangci/golangci-lint-action@v1
with:
version: v1.30
- name: go vet
run: go test ./...
- name: Build binaries
run: make
- name: Upload tink-server binary
uses: actions/upload-artifact@v2
with:
name: tink-server
path: ./cmd/tink-server/tink-server
- name: Upload tink-cli binary
uses: actions/upload-artifact@v2
with:
name: tink-cli
path: ./cmd/tink-cli/tink-cli
- name: Upload tink-worker binary
uses: actions/upload-artifact@v2
with:
name: tink-worker
path: ./cmd/tink-worker/tink-worker
- uses: cachix/install-nix-action@v10
with:
nix_path: nixpkgs=channel:nixos-unstable
- run: ./ci-checks.sh
docker-images:
env:
CGO_ENABLED: 0
runs-on: ubuntu-latest
needs: [validation]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download tink-cli binary
uses: actions/download-artifact@v2
with:
name: tink-cli
path: ./cmd/tink-cli/tink-cli
- name: Download tink-server binary
uses: actions/download-artifact@v2
with:
name: tink-server
path: ./cmd/tink-server/tink-server
- name: Download tink-worker binary
uses: actions/download-artifact@v2
with:
name: tink-worker
path: ./cmd/tink-worker/tink-worker
- name: quay.io/tinkerbell/tink
uses: docker/build-push-action@v1
with:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
repository: tinkerbell/tink
path: ./cmd/tink-server/
registry: quay.io
push: ${{ startsWith(github.ref, 'refs/heads/master') }}
tags: latest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add

tag_with_ref: true
tag_with_sha: true

too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those options will push:

Successfully tagged quay.io/tinkerbell/tink:latest
Successfully tagged quay.io/tinkerbell/tink:pr-235-merge
Successfully tagged quay.io/tinkerbell/tink:sha-f009303

I don't think we want that

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do. Maybe not tag_wit_ref for pushes, but definitely for tags. But I do want the sha so we can have point-in-time refs to images, and not just latest that keeps getting pushed up.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I will leave this tag_with_sha: true.
About tags, that's a separate discussion btw. It is not covered here and I will add it as soon as we get closer to a release lifecycle plan.

it does not look we are close to it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree.

tag_with_sha: true
- name: quay.io/tinkerbell/tink-cli
uses: docker/build-push-action@v1
with:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
repository: tinkerbell/tink-cli
path: ./cmd/tink-cli/
registry: quay.io
push: ${{ startsWith(github.ref, 'refs/heads/master') }}
tags: latest
tag_with_sha: true
- name: quay.io/tinkerbell/tink-worker
uses: docker/build-push-action@v1
with:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
repository: tinkerbell/tink-worker
path: ./cmd/tink-worker/
registry: quay.io
push: ${{ startsWith(github.ref, 'refs/heads/master') }}
tags: latest
tag_with_sha: true