diff --git a/ci/phoenix.yml b/ci/phoenix.yml new file mode 100644 index 0000000..999f45f --- /dev/null +++ b/ci/phoenix.yml @@ -0,0 +1,51 @@ +name: Phoenix CI + +on: + push: + branches: [$default-branch] + pull_request: + branches: [$default-branch] + +jobs: + build: + name: Build and test + runs-on: ubuntu-latest + env: {MIX_ENV: test} + + services: + postgres: + image: postgres:13 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: phoenix_test # Replace with your test database name! + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: ['5432:5432'] + + steps: + - uses: actions/checkout@v2 + - name: Set up Elixir + uses: actions/setup-elixir@v1 + with: + elixir-version: '1.10.3' # Define the elixir version [required] + otp-version: '22.3' # Define the OTP version [required] + - name: Restore dependencies cache + uses: actions/cache@v2 + with: + path: deps + key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} + restore-keys: ${{ runner.os }}-mix- + - name: Restore build cache + uses: actions/cache@v2 + with: + path: deps + key: ${{ runner.os }}-build-${{ hashFiles('**/mix.lock') }} + restore-keys: ${{ runner.os }}-build- + - name: Install dependencies + run: mix deps.get + - name: Run tests + run: mix test diff --git a/ci/properties/phoenix.properties.json b/ci/properties/phoenix.properties.json new file mode 100644 index 0000000..c65a859 --- /dev/null +++ b/ci/properties/phoenix.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Phoenix", + "description": "Build and test an Elixir Phoenix project.", + "iconName": "phoenix", + "categories": ["Elixir", "Erlang", "Phoenix"] +}