• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: CI
2on: [push, pull_request]
3
4jobs:
5  test:
6    name: Test
7    runs-on: ubuntu-latest
8    strategy:
9      matrix:
10        rust: [stable, beta, nightly]
11    steps:
12      - uses: actions/checkout@master
13      - name: Install Rust Stable
14        run: |
15          rustup self update
16          rustup update ${{ matrix.rust }}
17          rustup default ${{ matrix.rust }}
18          rustc -vV
19      - name: Run tests
20        run: cargo test
21
22  rustfmt:
23    name: Rustfmt
24    runs-on: ubuntu-latest
25    steps:
26      - uses: actions/checkout@master
27      - name: Install Rust Stable
28        run: |
29          rustup update stable
30          rustup default stable
31          rustup component add rustfmt
32      - name: Run rustfmt
33        run: cargo fmt -- --check
34
35  publish_docs:
36    name: Publish Documentation
37    runs-on: ubuntu-latest
38    steps:
39      - uses: actions/checkout@master
40      - name: Install Rust Stable
41        run: |
42          rustup update stable
43          rustup default stable
44      - name: Build documentation
45        run: cargo doc --no-deps
46      - name: Publish documentation
47        run: |
48          cd target/doc
49          git init
50          git remote add origin https://x-access-token:${{ secrets.github_token }}@github.com/${{ github.repository }}
51          git fetch origin
52          git reset --hard "origin/gh-pages^" --
53          git add .
54          git -c user.name='ci' -c user.email='ci' commit -m init
55          git push -f -q origin HEAD:gh-pages
56        if: github.event_name == 'push' && github.event.ref == 'refs/heads/master'
57