ci: run test on all pushes
This commit is contained in:
14
.github/workflows/rust.yaml
vendored
14
.github/workflows/rust.yaml
vendored
@@ -2,7 +2,6 @@ name: Rust build, test, and generate specification
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [master]
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [master]
|
branches: [master]
|
||||||
|
|
||||||
@@ -33,7 +32,6 @@ jobs:
|
|||||||
command: test
|
command: test
|
||||||
|
|
||||||
- name: Run services in background
|
- name: Run services in background
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
run: |
|
run: |
|
||||||
docker-compose -f docker-compose.db.yml up -d
|
docker-compose -f docker-compose.db.yml up -d
|
||||||
|
|
||||||
@@ -45,23 +43,23 @@ jobs:
|
|||||||
command: test
|
command: test
|
||||||
|
|
||||||
- name: Copy .env.example
|
- name: Copy .env.example
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request' && github.ref_name == 'master'
|
||||||
run: |
|
run: |
|
||||||
cp .env.example .env
|
cp .env.example .env
|
||||||
|
|
||||||
- name: Start API in background
|
- name: Start API in background
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request' && github.ref_name == 'master'
|
||||||
run: |
|
run: |
|
||||||
cargo run --bin revolt-delta &
|
cargo run --bin revolt-delta &
|
||||||
|
|
||||||
- name: Wait for API to go up
|
- name: Wait for API to go up
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request' && github.ref_name == 'master'
|
||||||
uses: nev7n/wait_for_response@v1
|
uses: nev7n/wait_for_response@v1
|
||||||
with:
|
with:
|
||||||
url: "http://localhost:8000/"
|
url: "http://localhost:8000/"
|
||||||
|
|
||||||
- name: Checkout API repository
|
- name: Checkout API repository
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request' && github.ref_name == 'master'
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
repository: revoltchat/api
|
repository: revoltchat/api
|
||||||
@@ -69,11 +67,11 @@ jobs:
|
|||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
|
|
||||||
- name: Download OpenAPI specification
|
- name: Download OpenAPI specification
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request' && github.ref_name == 'master'
|
||||||
run: curl http://localhost:8000/openapi.json -o api/OpenAPI.json
|
run: curl http://localhost:8000/openapi.json -o api/OpenAPI.json
|
||||||
|
|
||||||
- name: Commit changes
|
- name: Commit changes
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request' && github.ref_name == 'master'
|
||||||
uses: EndBug/add-and-commit@v4
|
uses: EndBug/add-and-commit@v4
|
||||||
with:
|
with:
|
||||||
cwd: "api"
|
cwd: "api"
|
||||||
|
|||||||
Reference in New Issue
Block a user