forked from rust-lang/docs.rs
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (49 loc) · 1.63 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
on: [push, pull_request]
name: CI
env:
RUST_BACKTRACE: 1
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 2
- name: Install stable Rust
run: rustup update stable && rustup default stable
- name: Install PostgreSQL
run: |
sudo apt-get update && DEBIAN_FRONTEND=noninteractive sudo apt-get install -y postgresql
sudo systemctl start postgresql
sudo -u postgres createuser $(whoami) -w
sudo -u postgres createdb $(whoami) -O $(whoami)
echo "::set-env name=CRATESFYI_DATABASE_URL::postgresql://$(whoami)@%2Fvar%2Frun%2Fpostgresql/$(whoami)"
- name: Build docs.rs
run: cargo build
- name: Prepare the test environment
run: |
prefix=$(pwd)/ignored/prefix
mkdir -p ${prefix}/public-html
echo "::set-env name=CRATESFYI_PREFIX::${prefix}"
- name: Test docs.rs
run: cargo test -- --test-threads=1
docker:
name: Docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 2
- name: Build the Docker image
run: docker build -t docsrs .
- name: Upload the Docker image to ECR
uses: rust-lang/simpleinfra/github-actions/upload-docker-image@master
with:
image: docsrs
repository: docsrs
region: us-west-1
aws_access_key_id: "${{ secrets.aws_access_key_id }}"
aws_secret_access_key: "${{ secrets.aws_secret_access_key }}"
if: github.ref == 'refs/heads/master'