From 7b4959da6f85a73c7d1d62d1b53cd4b6fdcd2044 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Tue, 13 Aug 2019 12:43:15 +0200 Subject: ci: add github actions --- .github/workflows/main.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/main.yml (limited to '.github') diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..f1340f1 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,40 @@ +on: [push, pull_request] + +jobs: + ci: + name: CI + runs-on: ubuntu-latest + steps: + + - uses: actions/checkout@master + with: + fetch-depth: 1 + + - name: Install Rust Stable + run: | + rustc -vV + rustup update stable + rustup default stable + rustc -vV + + - name: Validate the repository contents + run: cargo run -- check --strict + env: + GITHUB_TOKEN: ${{ secrets.github_token }} + + - name: Run rustfmt + run: cargo fmt -- --check + + - name: Run clippy + run: cargo clippy -- -Dwarnings + + - name: Build the contents of the static API + run: | + cargo run -- static-api build + echo "team-api.infra.rust-lang.org" > build/CNAME + + - uses: rust-lang/simpleinfra/github-actions/static-websites@master + with: + deploy_dir: build + github_token: "${{ secrets.github_token }}" + if: github.ref == 'refs/heads/master' -- cgit v1.2.3