This repository has been archived by the owner on Dec 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #267 from vania-pooh/master
Migrated to Github Actions (fixes #265)
- Loading branch information
Showing
9 changed files
with
157 additions
and
74 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
golang: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Golang | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.14.x | ||
|
||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Test | ||
run: ci/test.sh | ||
|
||
- name: Build | ||
run: ci/build.sh | ||
|
||
- name: Latest image | ||
env: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
run: ci/docker-push.sh latest | ||
|
||
- name: Latest docs | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: ci/docs.sh latest ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: build | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
golang: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Golang | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.14.x | ||
|
||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Test | ||
run: ci/test.sh | ||
|
||
- name: Build | ||
run: ci/build.sh | ||
|
||
- name: Prepare release version | ||
run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF:10} | ||
|
||
- uses: AButler/[email protected] | ||
with: | ||
files: 'dist/*' | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Release image | ||
env: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
run: ci/docker-push.sh $RELEASE_VERSION | ||
|
||
- name: Latest release image | ||
env: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
run: ci/docker-push.sh latest-release | ||
|
||
- name: Latest docs | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: ci/docs.sh $RELEASE_VERSION ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: test | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
golang: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Golang | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.14.x | ||
|
||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Test | ||
run: ci/test.sh | ||
|
||
- name: Build | ||
run: ci/build.sh | ||
|
||
- uses: codecov/codecov-action@v1 | ||
with: | ||
flags: go |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
export GO111MODULE="on" | ||
go get -u github.com/mitchellh/gox # cross compile | ||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-X github.com/aerokube/cm/cmd.buildStamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X github.com/aerokube/cm/cmd.gitRevision=`git describe --tags || git rev-parse HEAD` -s -w" | ||
gox -os "linux darwin windows" -arch "amd64" -osarch="windows/386" -output "dist/{{.Dir}}_{{.OS}}_{{.Arch}}" -ldflags "-X github.com/aerokube/cm/cmd.buildStamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X github.com/aerokube/cm/cmd.gitRevision=`git describe --tags || git rev-parse HEAD` -s -w" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
docker build -t $GITHUB_REPOSITORY . | ||
docker tag $GITHUB_REPOSITORY $GITHUB_REPOSITORY:$1 | ||
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" | ||
docker push $GITHUB_REPOSITORY | ||
docker push $GITHUB_REPOSITORY:$1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,37 +3,37 @@ | |
set -e | ||
TAGNAME=$1 | ||
GH_REF=github.com/aerokube/cm.git | ||
git config user.name "${TRAVIS_REPO_SLUG}" | ||
git config user.name "${GITHUB_REPOSITORY}" | ||
git config user.email "[email protected]" | ||
git remote add upstream "https://${GITHUB_TOKEN}@${GH_REF}" | ||
git fetch upstream | ||
|
||
git branch -r | ||
|
||
echo "Deleting old output" | ||
rm -rf ${TRAVIS_BUILD_DIR}/docs/output | ||
mkdir ${TRAVIS_BUILD_DIR}/docs/output | ||
rm -rf ${GITHUB_WORKSPACE}/docs/output | ||
mkdir ${GITHUB_WORKSPACE}/docs/output | ||
git worktree prune | ||
rm -rf ${TRAVIS_BUILD_DIR}/.git/worktrees/docs/output/ | ||
rm -rf ${GITHUB_WORKSPACE}/.git/worktrees/docs/output/ | ||
|
||
echo "Checking out gh-pages branch into docs/output" | ||
git worktree add -B gh-pages ${TRAVIS_BUILD_DIR}/docs/output upstream/gh-pages | ||
git worktree add -B gh-pages ${GITHUB_WORKSPACE}/docs/output upstream/gh-pages | ||
|
||
echo "Removing existing files" | ||
mkdir -p ${TRAVIS_BUILD_DIR}/docs/output/${TAGNAME} | ||
rm -rf ${TRAVIS_BUILD_DIR}/docs/output/${TAGNAME}/* | ||
mkdir -p ${GITHUB_WORKSPACE}/docs/output/${TAGNAME} | ||
rm -rf ${GITHUB_WORKSPACE}/docs/output/${TAGNAME}/* | ||
|
||
echo "Copying images" | ||
cp -R ${TRAVIS_BUILD_DIR}/docs/img ${TRAVIS_BUILD_DIR}/docs/output/${TAGNAME}/img | ||
cp -R ${GITHUB_WORKSPACE}/docs/img ${GITHUB_WORKSPACE}/docs/output/${TAGNAME}/img | ||
echo "Copying files to root" | ||
cp -Rv ${TRAVIS_BUILD_DIR}/docs/files/* ${TRAVIS_BUILD_DIR}/docs/output | ||
cp -Rv ${GITHUB_WORKSPACE}/docs/files/* ${GITHUB_WORKSPACE}/docs/output | ||
|
||
echo "Generating docs" | ||
docker run -v ${TRAVIS_BUILD_DIR}/docs/:/documents/ --name asciidoc-to-html asciidoctor/docker-asciidoctor asciidoctor -a revnumber=${TAGNAME} -D /documents/output/${TAGNAME} index.adoc | ||
docker run -v ${GITHUB_WORKSPACE}/docs/:/documents/ --name asciidoc-to-html asciidoctor/docker-asciidoctor asciidoctor -a revnumber=${TAGNAME} -D /documents/output/${TAGNAME} index.adoc | ||
|
||
|
||
echo "Updating gh-pages branch" | ||
cd ${TRAVIS_BUILD_DIR}/docs/output && git add --all && git status && git commit -m "Publishing to gh-pages" | ||
cd ${GITHUB_WORKSPACE}/docs/output && git add --all && git status && git commit -m "Publishing to gh-pages" | ||
|
||
|
||
git push upstream HEAD:gh-pages |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
export GO111MODULE="on" | ||
go test -race -v github.com/aerokube/cm/selenoid -coverprofile=coverage.txt -covermode=atomic -coverpkg github.com/aerokube/cm/selenoid |
This file was deleted.
Oops, something went wrong.