Skip to content

Update CI #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 23 additions & 46 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,51 +9,39 @@ on:
jobs:
rustfmt:
name: Rustfmt
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup 1.42.0-x86_64-unknown-linux-gnu
uses: actions-rs/toolchain@v1
- name: Set up Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.42.0-x86_64-unknown-linux-gnu
override: true
profile: minimal
components: rustfmt

- name: '`cargo fmt -- --check`'
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
run: cargo fmt -- --check

- name: '`cargo fmt --manifest-path ./xtask/Cargo.toml -- --check`'
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path ./xtask/Cargo.toml -- --check
run: cargo fmt --manifest-path ./xtask/Cargo.toml -- --check

build:
strategy:
fail-fast: false
matrix:
toolchain:
# `x86_64-pc-windows-gnu` is tier 1 **for now**.
- 1.42.0-x86_64-pc-windows-msvc
- 1.42.0-x86_64-pc-windows-gnu
Comment on lines -43 to -45
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

なんか動かなくなっていたので、とりあえず削除
https://github.com/rust-lang-ja/atcoder-rust-base/actions/runs/4708393204/jobs/8350803116

- 1.42.0-x86_64-apple-darwin
- 1.42.0-x86_64-unknown-linux-gnu
include:
- toolchain: 1.42.0-x86_64-pc-windows-msvc
os: windows-latest
- toolchain: 1.42.0-x86_64-pc-windows-gnu
os: windows-latest
os: windows-2022
- toolchain: 1.42.0-x86_64-apple-darwin
os: macOS-latest
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

macos-12だとRust 1.42が動かないらしいので、とりあえずmacos-11
https://github.com/rust-lang-ja/atcoder-rust-base/actions/runs/4708393204/jobs/8350803160

os: macos-11
- toolchain: 1.42.0-x86_64-unknown-linux-gnu
os: ubuntu-18.04
os: ubuntu-22.04

name: ${{ matrix.toolchain }}
runs-on: ${{ matrix.os }}
Expand All @@ -64,47 +52,36 @@ jobs:
if: matrix.os == 'windows-latest'

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
override: true
profile: minimal
components: clippy

- name: '`rustup override set ${{ matrix.toolchain }}`'
run: rustup override set ${{ matrix.toolchain }}
Comment on lines 57 to +64
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RustにおけるGitHub Actionsベストプラクティス

補足すると、actions-rsがメンテされなくなったのは2020年で、2021年の春を最後に応答もしなくなった...と記憶しています。どうだったっけ?


- name: Setup Python 3.8
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: '3.8'

- name: Rust Cache
uses: Swatinem/rust-cache@v2

- name: '`cargo clippy --all-targets --profile test -- -D warnings`'
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --profile test -- -D warnings
run: cargo clippy --all-targets --profile test -- -D warnings

- name: '`cargo clippy --manifest-path ./xtask/Cargo.toml -- -D warnings`'
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path ./xtask/Cargo.toml -- -D warnings
run: cargo clippy --manifest-path ./xtask/Cargo.toml -- -D warnings

- name: '`cargo test --all-targets --no-fail-fast`'
uses: actions-rs/cargo@v1
with:
command: test
args: --all-targets --no-fail-fast
run: cargo test --all-targets --no-fail-fast

- name: '`cargo run --release`'
uses: actions-rs/cargo@v1
with:
command: run
args: --release
run: cargo run --release

- name: '`cargo xtask test-examples`'
uses: actions-rs/cargo@v1
with:
command: xtask
args: test-examples
run: cargo xtask test-examples
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy