Alternative ATProto PDS implementation
1name: Build
2
3on:
4 push:
5 branches:
6 - main
7 pull_request:
8 branches:
9 - main
10
11env:
12 CARGO_TERM_COLOR: always
13
14# Elevate GITHUB_TOKEN permissions for dependabot workflows
15permissions:
16 contents: write
17 pull-requests: write
18
19jobs:
20 # https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#approve-a-pull-request
21 dependabot:
22 runs-on: ubuntu-latest
23 if: github.actor == 'dependabot[bot]'
24 steps:
25 - name: Dependabot metadata
26 id: metadata
27 uses: dependabot/fetch-metadata@v1
28 with:
29 github-token: "${{ secrets.GITHUB_TOKEN }}"
30 - name: Enable auto-merge for Dependabot PRs
31 # if: contains(steps.metadata.outputs.dependency-names, 'my-dependency') && steps.metadata.outputs.update-type == 'version-update:semver-patch'
32 run: gh pr merge --auto --merge "$PR_URL"
33 env:
34 PR_URL: ${{github.event.pull_request.html_url}}
35 GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
36
37 build:
38 runs-on: ${{ matrix.os }}
39 env:
40 RUST_BACKTRACE: 1
41 strategy:
42 matrix:
43 build: [ubuntu64, win64]
44 include:
45 - build: ubuntu64
46 os: ubuntu-latest
47 host_target: x86_64-unknown-linux-gnu
48 artifact: bluepds
49 - build: win64
50 os: windows-latest
51 host_target: x86_64-pc-windows-msvc
52 artifact: bluepds.exe
53 steps:
54 - uses: actions/checkout@v2
55
56 - name: Install latest stable
57 uses: dtolnay/rust-toolchain@stable
58 with:
59 targets: ${{ matrix.host_target }}
60
61 - name: test
62 run: cargo test --release
63
64 - name: build
65 run: cargo build --target ${{ matrix.host_target }} --release
66
67 - name: upload artifacts
68 uses: actions/upload-artifact@v4
69 with:
70 # Artifact name
71 name: ${{ matrix.artifact }}
72 # A file, directory or wildcard pattern that describes what to upload
73 path: target/${{ matrix.host_target }}/release/${{ matrix.artifact }}
74
75 fmt:
76 name: check formatting
77 runs-on: ubuntu-latest
78 steps:
79 - uses: actions/checkout@v2
80 - name: Install latest stable
81 uses: dtolnay/rust-toolchain@stable
82 - name: Check formatting
83 run: cargo fmt --all -- --check