noahsettersten commited on
Commit
ee18265
1 Parent(s): 92bfb3b

ci: Create separate `test` workflow that uses Postgres

Browse files
.github/workflows/lint.yml CHANGED
@@ -31,6 +31,3 @@ jobs:
31
 
32
  - name: Check code style
33
  run: mix credo
34
-
35
- - name: Run tests
36
- run: mix test
 
31
 
32
  - name: Check code style
33
  run: mix credo
 
 
 
.github/workflows/test.yml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Create initial workflow based on GitHub's suggestion for Elixir.
2
+
3
+ on:
4
+ push:
5
+ branches: ["main"]
6
+ pull_request:
7
+ branches: ["main"]
8
+
9
+ jobs:
10
+ test:
11
+ name: Test codebase
12
+ runs-on: ubuntu-latest
13
+
14
+ services:
15
+ postgres:
16
+ image: postgres
17
+ options: >-
18
+ --health-cmd pg_isready
19
+ --health-interval 10s
20
+ --health-timeout 5s
21
+ --health-retries 5
22
+
23
+ steps:
24
+ - name: Checkout code
25
+ uses: actions/checkout@v4
26
+
27
+ - name: Set up Elixir
28
+ uses: erlef/setup-beam@v1
29
+ with:
30
+ elixir-version: '1.16.0'
31
+ otp-version: '26.0'
32
+
33
+ - name: Cache dependencies
34
+ uses: actions/cache@v3
35
+ with:
36
+ path: deps
37
+ key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
38
+ restore-keys: ${{ runner.os }}-mix-
39
+
40
+ - name: Install dependencies
41
+ run: mix deps.get
42
+
43
+ - name: Run tests
44
+ run: mix test