Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github Actions Workflow #44

Open
joselo opened this issue Jun 25, 2020 · 2 comments
Open

Github Actions Workflow #44

joselo opened this issue Jun 25, 2020 · 2 comments

Comments

@joselo
Copy link

joselo commented Jun 25, 2020

Sorry for ask this here, I'm not sure if I need anything else in my github action workflow, the whole integration tests fails.

I really like phoenix_integration for integration tests, I really would appreciate If anyone can give me a good approach to run it using github actions.

  1) test Try to login with invalid company (Web.CompanyLoginTest)
     apps/web/test/web/integration/company_login_test.exs:7
     ** (RuntimeError) Failed to find link "Mis ofertas", :get in the response
     Expected to find an anchor with text containing "Mis ofertas"
     code: |> follow_link("Mis ofertas")
     stacktrace:
       (phoenix_integration) lib/phoenix_integration/requests.ex:773: PhoenixIntegration.Requests.find_html_link/3
       (phoenix_integration) lib/phoenix_integration/requests.ex:193: PhoenixIntegration.Requests.click_link/3
       (phoenix_integration) lib/phoenix_integration/requests.ex:255: PhoenixIntegration.Requests.follow_link/3
       test/web/integration/company_login_test.exs:9: (test)
name: Continuous Integration
on: [push]

# This workflow will build and test a Phoenix application that uses
# PostgreSQL as a database. Will also cache dependencies and build
# artifacts to speed up the build.
jobs:
  test:
    env:
      MIX_ENV: test
      TEST_DATABASE_NAME: postgres
      TEST_DATABASE_USERNAME: postgres
      TEST_DATABASE_PASSWORD: postgres
      TEST_DATABASE_HOSTNAME: localhost
      TEST_DATABASE_PORT: 5432
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [10.x]
        otp-version: [22.2]
        elixir-version: [1.9.4]

    services:
      db:
        env:
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: postgres
          POSTGRES_DB: postgres
        image: postgres:11
        ports: ['5432:5432']
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
    steps:
      - uses: actions/[email protected]
      - name: Recover dependency cache
        uses: actions/cache@v1
        id: deps_cache
        with:
          path: deps
          key: ${{ runner.OS }}-deps-${{ hashFiles('**/mix.lock') }}
          restore-keys: |
            ${{ runner.OS }}-deps-${{ env.cache-name }}-
            ${{ runner.OS }}-deps-
            ${{ runner.OS }}-

      - name: Copy config file
        run: cp config/env.local.exs.example config/env.local.exs

      - name: Recover build cache
        uses: actions/cache@v1
        with:
          path: _build
          key: ${{ runner.OS }}-build-${{ env.cache-name }}
          restore-keys: |
            ${{ runner.OS }}-build-
            ${{ runner.OS }}-

      - uses: actions/[email protected]
        with:
          otp-version: ${{ matrix.otp-version }}
          elixir-version: ${{ matrix.elixir-version }}

      - uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}

      - name: Install Dependencies
        run: mix local.rebar --force
      - run: mix local.hex --force
      - run: mix deps.get
      - run: mix compile
      - run: mix ecto.migrate
      - run: npm install --prefix ./apps/web/assets
      - run: npm run deploy --prefix ./apps/web/assets

      - name: Run tests
        run: mix test --trace
@marick
Copy link
Contributor

marick commented Jul 28, 2020

I'm sorry, I have no experience with Github actions.

@boydm
Copy link
Owner

boydm commented Sep 25, 2021

Sorry. I don't either

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants