Skip to content

shim: ncc based shim for downloading and running #72

shim: ncc based shim for downloading and running

shim: ncc based shim for downloading and running #72

Workflow file for this run

name: Go Continuous Integration
on:
push:
branches:
- master
pull_request:
jobs:
shim:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20.x
cache: 'npm'
- name: Install
run: |
npm i
npm i -g @vercel/ncc
npm run shim
- name: verify no git diff
run: |
status=$(git status --porcelain)
if [ -n "$status" ]; then
echo "you need to run 'npm run shim' and commit the changes"
echo "$status"
exit 1
fi
golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Run Go linters
uses: golangci/golangci-lint-action@v3
with:
args: --verbose --timeout=5m
skip-pkg-cache: true
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: ariga/setup-atlas@v0
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Run tests
run: go test -race ./...
integration-test:
runs-on: ubuntu-latest
steps:
- uses: ariga/setup-atlas@v0
with:
cloud-token: ${{ secrets.INTEGRATION_ATLAS_CLOUD_TOKEN }}
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- run: go install ./cmd/atlas-action
- uses: ./migrate/apply
with:
dir: file://atlasaction/testdata/migrations
url: sqlite://file.db?mode=memory
- uses: ./migrate/push
id: push_action
with:
dir: file://atlasaction/testdata/migrations
dir-name: test-dir
dev-url: sqlite://file.db?mode=memory
- name: "Verify migrate/push output"
shell: bash
run: |
# Verifies that the output we got is a URL as expected
[[ "${{ steps.push_action.outputs.url }}" =~ ^https://[a-zA-Z-]*\.atlasgo\.[a-zA-Z-]*/.*$ ]]