Files
performance_aware_programming/.github/workflows/rust.yml
Smaug123 cf16c3a34d
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/all-checks-complete Pipeline was successful
ci/woodpecker/pr/build Pipeline failed
ci/woodpecker/pr/all-checks-complete unknown status
Fix required checks
2024-07-14 13:11:12 +01:00

242 lines
6.8 KiB
YAML

name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
{
"runs-on": "ubuntu-latest",
"steps": [
{
"name": "Checkout",
"uses": "actions/checkout@v3"
},
{
"name": "Checkout submodules",
"shell": "bash",
"run": "auth_header=\"$(git config --local --get http.https://github.com/.extraheader)\" git submodule sync --recursive && git -c \"http.extraheader=$auth_header\" -c protocol.version=2 submodule update --init --force --recursive --depth=1"
},
{
"name": "Install Nix",
"uses": "cachix/install-nix-action@v17",
"with": { "extra-nix-config": "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" }
},
{
"name": "cargo test",
"run": "nix develop --command cargo test --verbose"
}
]
}
build-release:
{
"runs-on": "ubuntu-latest",
"steps": [
{
"name": "Checkout",
"uses": "actions/checkout@v3"
},
{
"name": "Checkout submodules",
"run": "auth_header=\"$(git config --local --get http.https://github.com/.extraheader)\" git submodule sync --recursive && git -c \"http.extraheader=$auth_header\" -c protocol.version=2 submodule update --init --force --recursive --depth=1"
},
{
"name": "Install Nix",
"uses": "cachix/install-nix-action@v17",
"with": { "extra-nix-config": "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" }
},
{
"name": "cargo test (release)",
"run": "nix develop --command cargo test --verbose --release"
}
]
}
alejandra:
{
"name": "Nix formatting",
"runs-on": "ubuntu-latest",
"steps": [
{
"uses": "actions/checkout@v3",
"name": "Checkout"
},
{
"name": "Install Nix",
"uses": "cachix/install-nix-action@v17",
"with": { "extra-nix-config": "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" }
},
{
"name": "Run Alejandra",
"run": "nix develop .#ci --command alejandra -- --check ."
}
]
}
rust-fmt:
{
"name": "Rust formatting",
"runs-on": "ubuntu-latest",
"steps": [
{
"uses": "actions/checkout@v3",
"name": "Checkout"
},
{
"name": "Install Nix",
"uses": "cachix/install-nix-action@v17",
"with": { "extra-nix-config": "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" }
},
{
"name": "Run formatter",
"run": "nix develop --command cargo -- fmt --all -- --check"
}
]
}
clippy:
{
"name": "Clippy",
"runs-on": "ubuntu-latest",
"steps": [
{
"uses": "actions/checkout@v3",
"name": "Checkout"
},
{
"name": "Install Nix",
"uses": "cachix/install-nix-action@v17",
"with": { "extra-nix-config": "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" }
},
{
"name": "Run Clippy",
"run": "nix develop --command cargo -- clippy -- -D warnings"
}
]
}
nix-build:
{
"name": "Nix build",
"runs-on": "ubuntu-latest",
"steps": [
{
"uses": "actions/checkout@v3",
"name": "Checkout"
},
{
"name": "Install Nix",
"uses": "cachix/install-nix-action@v17",
"with": { "extra-nix-config": "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" }
},
{
"name": "Build app",
"run": "nix build"
}
]
}
nix-run:
{
"name": "Run app through Nix",
"runs-on": "ubuntu-latest",
"steps": [
{
"uses": "actions/checkout@v3",
"name": "Checkout"
},
{
"name": "Checkout submodules",
"run": "auth_header=\"$(git config --local --get http.https://github.com/.extraheader)\" git submodule sync --recursive && git -c \"http.extraheader=$auth_header\" -c protocol.version=2 submodule update --init --force --recursive --depth=1"
},
{
"name": "Install Nix",
"uses": "cachix/install-nix-action@v17",
"with": { "extra-nix-config": "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" }
},
{
"name": "Run app (verify consistency)",
"run": "nix run . -- computer_enhance/perfaware/part1/listing_0038_many_register_mov computer_enhance/perfaware/part1/listing_0038_many_register_mov.asm"
},
{
"name": "Run app",
"run": "nix run . -- computer_enhance/perfaware/part1/listing_0055_challenge_rectangle computer_enhance/perfaware/part1/listing_0055_challenge_rectangle.asm"
}
]
}
linkcheck:
{
"name": "Check links",
"runs-on": "ubuntu-latest",
"steps": [
{
"uses": "actions/checkout@v3",
"name": "Checkout"
},
{
"name": "Install Nix",
"uses": "cachix/install-nix-action@v17",
"with": { "extra-nix-config": "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" }
},
{
"name": "Run link checker",
"run": "nix develop .#ci --command markdown-link-check README.md"
}
]
}
round_trip:
{
"name": "Round-trip generator and consumer",
"runs-on": "ubuntu-latest",
"steps": [
{
"uses": "actions/checkout@v3",
"name": "Checkout"
},
{
"name": "Install Nix",
"uses": "cachix/install-nix-action@v17",
"with": { "extra-nix-config": "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" }
},
{
"name": "Run generator",
"run": "nix develop . --command cargo run --release --bin generator --package generator -- 12345 100"
},
{
"name": "Run consumer",
"run": "nix develop . --command cargo run --release --bin haversine-app --package haversine-app -- data_100_flex.json data_100_haveranswer.f64"
}
]
}
all-required-checks-complete:
{
"needs": [
'nix-build',
'nix-run',
'build',
'build-release',
'alejandra',
'clippy',
'rust-fmt',
'linkcheck',
],
"runs-on": "ubuntu-latest",
"if": "${{ always() }}",
"steps": [
{
"uses": "Smaug123/all-required-checks-complete-action@05b40a8c47ef0b175ea326e9abb09802cb67b44e",
"with": { "needs-context": "${{ toJson(needs) }}" }
}
]
}