Skip to content

readme: deprecation notice (#28) #182

readme: deprecation notice (#28)

readme: deprecation notice (#28) #182

Workflow file for this run

name: CI (Go)
on:
push:
workflow_dispatch:
jobs:
golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.21'
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run Go linters
uses: golangci/golangci-lint-action@v3
with:
args: --timeout=15m --verbose --enable whitespace,gocritic,goimports,revive
skip-pkg-cache: true
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.21'
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run tests
run: go test -race ./...
integration-tests:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
services:
# Spin up a mysql:8 container to be used as the dev-database for analysis.
mysql:
image: mysql:8
env:
MYSQL_DATABASE: dev
MYSQL_ROOT_PASSWORD: pass
options: >-
--health-cmd "mysqladmin ping -ppass"
--health-interval 10s
--health-start-period 10s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build
uses: docker/build-push-action@v2
with:
context: .
file: ./.github/workflows/Dockerfile
tags: local
load: true
- name: sanity-push
uses: ./internal/action
with:
dir: internal/testdata/basic/migrations
name: sync-action-integration-test
cloud-token: ${{ secrets.INTEGRATION_ATLAS_CLOUD_TOKEN }}
dev-url: "mysql://root:pass@mysql:3306/dev"
- name: no-dev-url
uses: ./internal/action
continue-on-error: true
with:
dir: internal/testdata/basic/migrations
name: sync-action-integration-test
cloud-token: ${{ secrets.INTEGRATION_ATLAS_CLOUD_TOKEN }}
- name: check no-dev-url failure
if: steps.no-dev-url.outcome == 'success'
uses: actions/github-script@v3
with:
script: |
core.setFailed('action did not fail without dev-url')
- name: sanity-public
uses: ./internal/action
with:
name: sync-action-integration-test
dir: internal/testdata/basic/migrations
driver: sqlite
cloud-public: true
cloud-url: https://gh-api.atlasgo.link
docker:
runs-on: ubuntu-latest
needs: [golangci-lint, unit-tests, integration-tests]
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
file: ./.github/workflows/Dockerfile
tags: arigaio/atlas-sync-action:latest