Giter Club home page Giter Club logo

setup-sqlserver's Introduction

setup-sqlserver

The missing action for SQL Server 🎉

  • Simpler than containers
  • Works on Linux and Windows
  • Supports different versions

Build Status

Getting Started

Add it as a step to your workflow

      - uses: ankane/setup-sqlserver@v1
        with:
          accept-eula: true

accept-eula confirms your acceptance of the End-User Licensing Agreement

Versions

Specify a version

      - uses: ankane/setup-sqlserver@v1
        with:
          accept-eula: true
          sqlserver-version: 2019

Currently supports

Version 2022 2019
ubuntu-22.04
ubuntu-20.04 default
windows-2022 default
windows-2019 default

Test against multiple versions

    strategy:
      matrix:
        sqlserver-version: [2022, 2019]
    steps:
      - uses: ankane/setup-sqlserver@v1
        with:
          accept-eula: true
          sqlserver-version: ${{ matrix.sqlserver-version }}

Extra Steps

Create a database

      - run: sqlcmd -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE testdb'

Run queries

      - run: sqlcmd -U SA -P 'YourStrong!Passw0rd' -d testdb -Q 'SELECT @@VERSION'

Related Actions

Resources

Linux

Windows

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

setup-sqlserver's People

Contributors

ankane avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

setup-sqlserver's Issues

Ideas

Ideas

  • Add sa-password input
  • Add database input - database branch
  • Add mssql-pid input

Unable to locate package mssql-server

I suddenly started receiving an Unable to locate package mssql-server error during a Github action using a GitHub Ubuntu runner. I am still investigating but raising this here in case others are seeing the same issue.

wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key([8](https://github.com/anthonylangsworth/OrderBot/actions/runs/3654610362/jobs/6175188204#step:3:9))).
OK
wget -qO- https://packages.microsoft.com/config/ubuntu/$(. /etc/os-release && echo $VERSION_ID)/mssql-server-201[9](https://github.com/anthonylangsworth/OrderBot/actions/runs/3654610362/jobs/6175188204#step:3:10).list | sudo tee /etc/apt/sources.list.d/mssql-server-2019.list
sudo apt-get update
Hit:1 http://azure.archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://azure.archive.ubuntu.com/ubuntu jammy-updates InRelease [114 kB]
Get:3 http://azure.archive.ubuntu.com/ubuntu jammy-backports InRelease [99.8 kB]
Get:4 http://azure.archive.ubuntu.com/ubuntu jammy-security InRelease [1[10](https://github.com/anthonylangsworth/OrderBot/actions/runs/3654610362/jobs/6175188204#step:3:11) kB]
Get:5 https://packages.microsoft.com/ubuntu/22.04/prod jammy InRelease [10.5 kB]
Get:6 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [758 kB]
Get:7 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main Translation-en [169 kB]
Get:8 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main amd64 c-n-f Metadata [[11](https://github.com/anthonylangsworth/OrderBot/actions/runs/3654610362/jobs/6175188204#step:3:12).4 kB]
Get:9 http://azure.archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [488 kB]
Get:10 http://azure.archive.ubuntu.com/ubuntu jammy-updates/restricted Translation-en [74.9 kB]
Get:11 http://azure.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [761 kB]
Get:[12](https://github.com/anthonylangsworth/OrderBot/actions/runs/3654610362/jobs/6175188204#step:3:13) http://azure.archive.ubuntu.com/ubuntu jammy-updates/universe Translation-en [128 kB]
Get:[13](https://github.com/anthonylangsworth/OrderBot/actions/runs/3654610362/jobs/6175188204#step:3:14) http://azure.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 c-n-f Metadata [[14](https://github.com/anthonylangsworth/OrderBot/actions/runs/3654610362/jobs/6175188204#step:3:15).0 kB]
Get:14 http://azure.archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [7300 B]
Get:[15](https://github.com/anthonylangsworth/OrderBot/actions/runs/3654610362/jobs/6175188204#step:3:16) http://azure.archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [3324 B]
Get:[16](https://github.com/anthonylangsworth/OrderBot/actions/runs/3654610362/jobs/6175188204#step:3:17) http://azure.archive.ubuntu.com/ubuntu jammy-backports/main Translation-en [1580 B]
Get:17 http://azure.archive.ubuntu.com/ubuntu jammy-backports/main amd64 c-n-f Metadata [272 B]
Get:18 http://azure.archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [6740 B]
Get:19 http://azure.archive.ubuntu.com/ubuntu jammy-backports/universe amd64 c-n-f Metadata [348 B]
Get:20 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main arm64 Packages [16.7 kB]
Get:21 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main armhf Packages [10.6 kB]
Get:22 http://azure.archive.ubuntu.com/ubuntu jammy-security/main amd64 Packages [524 kB]
Get:23 http://azure.archive.ubuntu.com/ubuntu jammy-security/main Translation-en [113 kB]
Get:24 http://azure.archive.ubuntu.com/ubuntu jammy-security/main amd64 c-n-f Metadata [7352 B]
Get:25 http://azure.archive.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [448 kB]
Get:26 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main amd64 Packages [60.1 kB]
Get:27 http://azure.archive.ubuntu.com/ubuntu jammy-security/restricted Translation-en [68.9 kB]
Get:28 http://azure.archive.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [622 kB]
Get:29 http://azure.archive.ubuntu.com/ubuntu jammy-security/universe Translation-en [82.7 kB]
Get:30 http://azure.archive.ubuntu.com/ubuntu jammy-security/universe amd64 c-n-f Metadata [11.0 kB]
Hit:31 https://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu jammy InRelease
Fetched 4723 kB in 1s (4321 kB/s)
Reading package lists...
sudo apt-get install mssql-server mssql-tools
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package mssql-server
node:child_process:903
   throw err;
   ^

Error: Command failed: sudo apt-get install mssql-server mssql-tools
   at checkExecSyncError (node:child_process:826:11)
   at execSync (node:child_process:900:15)
   at run (/home/runner/work/_actions/ankane/setup-sqlserver/v1/index.js:10:3)
   at Object.<anonymous> (/home/runner/work/_actions/ankane/setup-sqlserver/v1/index.js:91:3)
   at Module._compile (node:internal/modules/cjs/loader:1101:14)
   at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
   at Module.load (node:internal/modules/cjs/loader:981:32)
   at Function.Module._load (node:internal/modules/cjs/loader:822:12)
   at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
   at node:internal/main/run_main_module:[17](https://github.com/anthonylangsworth/OrderBot/actions/runs/3654610362/jobs/6175188204#step:3:18):47 {
 status: 100,
 signal: null,
 output: [ null, null, null ],
 pid: [25](https://github.com/anthonylangsworth/OrderBot/actions/runs/3654610362/jobs/6175188204#step:3:26)73,
 stdout: null,
 stderr: null
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.