Merge pull request #374 from wbbaddons/dependabot/cargo/serde-1.0.216 #1982
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (C) 2013 - 2021 Tim Düsterhus | |
# Copyright (C) 2021 Maximilian Mader | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU Affero General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
# GNU Affero General Public License for more details. | |
# | |
# You should have received a copy of the GNU Affero General Public License | |
# along with this program. If not, see <http:#www.gnu.org/licenses/>. | |
# | |
# SPDX-License-Identifier: AGPL-3.0-or-later | |
name: Test | |
on: | |
push: | |
pull_request: | |
permissions: | |
contents: read | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
cargo_build: | |
name: cargo build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: ci | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "22" | |
cache: "npm" | |
- run: npm ci | |
- run: cargo build --locked --verbose | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: tims-package-server | |
path: target/*/tims-package-server | |
if-no-files-found: error | |
retention-days: 2 | |
cargo_test: | |
name: cargo test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: ci | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "22" | |
cache: "npm" | |
- run: npm ci | |
- run: cargo test --locked --verbose | |
end_to_end_test: | |
name: End to end test | |
needs: | |
- cargo_build | |
runs-on: ubuntu-latest | |
steps: | |
- run: | | |
curl -fsSL https://github.com/Orange-OpenSource/hurl/releases/download/4.3.0/hurl_4.3.0_amd64.deb -o hurl.deb | |
sudo apt install ./hurl.deb | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: tims-package-server | |
- run: mv */tims-package-server . | |
- run: chmod +x ./tims-package-server | |
- run: sudo systemd-run --unit=tims-package-server --same-dir --uid="$(id -u)" ./tims-package-server | |
- run: sudo systemd-run --unit=file-server --working-directory=$(pwd)/tests/ --uid="$(id -u)" python3 -m http.server 9002 | |
- run: systemctl status tims-package-server | |
- name: Build packages | |
run: | | |
set -x | |
pushd tests/ | |
for package in be.bastelstu.*; do | |
mkdir "../packages/$package/" | |
pushd "$package" | |
for version in *.xml; do | |
tar cf "../../packages/$package/$(basename "$version" ".xml").tar" $version --transform 's~.*~package.xml~' | |
done | |
popd | |
done | |
popd | |
shell: bash | |
- run: hurl --file-root=$(pwd) --color --verbose --test tests/startup.hurl | |
- run: hurl --file-root=$(pwd) --color --verbose --test tests/test.hurl | |
- run: systemctl status tims-package-server | |
if: always() | |
- run: sudo systemctl stop tims-package-server | |
if: always() |