Skip to content

Commit b008149

Browse files
committed
ci: port Rust build and test to GitHub Actions
1 parent 232160f commit b008149

File tree

7 files changed

+75
-85
lines changed

7 files changed

+75
-85
lines changed

.github/workflows/pyoxidizer.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
on:
2+
- push
3+
- pull_request
4+
jobs:
5+
pyoxidizer:
6+
strategy:
7+
matrix:
8+
rust_toolchain:
9+
- 'stable'
10+
- 'beta'
11+
- 'nightly'
12+
# Remember to update MINIMUM_RUST_VERSION in pyoxidizer/src/environment.rs
13+
# and the `Installing Rust` documentation when this changes.
14+
- '1.45.0'
15+
os:
16+
- 'ubuntu-18.04'
17+
- 'macos-10.15'
18+
- 'windows-2019'
19+
continue-on-error: true
20+
runs-on: ${{ matrix.os }}
21+
env:
22+
IN_CI: '1'
23+
steps:
24+
- name: Install Linux system packages
25+
if: ${{ matrix.os == 'ubuntu-18.04' }}
26+
run: |
27+
sudo apt-get install -y libyaml-dev snapcraft
28+
29+
- uses: actions/checkout@v2
30+
31+
- uses: actions-rs/toolchain@v1
32+
with:
33+
toolchain: ${{ matrix.rust_toolchain }}
34+
profile: minimal
35+
36+
- uses: actions/setup-python@v2
37+
with:
38+
python-version: '3.8'
39+
40+
- name: Build Workspace
41+
run: |
42+
cargo build --workspace --exclude oxidized-importer
43+
cargo run --bin pyoxidizer -- --version
44+
45+
# TODO get pyembed working. It is complaining about a missing libpython.
46+
- name: Test Workspace
47+
run: |
48+
cargo test --workspace --exclude pyembed --exclude oxidized-importer
49+
50+
- name: Run Clippy
51+
if: ${{ matrix.rust_toolchain == 'stable' || matrix.rust_toolchain == 'beta' }}
52+
run: |
53+
cargo clippy --workspace --exclude oxdized_importer

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PyOxidizer
22

3-
[![Build Status](https://dev.azure.com/gregoryszorc/PyOxidizer/_apis/build/status/indygreg.PyOxidizer?branchName=main)](https://dev.azure.com/gregoryszorc/PyOxidizer/_build/latest?definitionId=1&branchName=main)
3+
[![Build Status](https://github.com/indygreg/PyOxidizer/workflows/.github/workflows/pyoxidizer.yml/badge.svg)](https://github.com/indygreg/PyOxidizer/actions)
44

55
`PyOxidizer` is a utility for producing binaries that embed Python.
66
The over-arching goal of `PyOxidizer` is to make complex packaging and

ci/azure-pipelines-template.yml

Lines changed: 0 additions & 62 deletions
This file was deleted.

ci/azure-pipelines.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

ci/install-rust-linux.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/history.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ New Features
6161
method to obtain a ``WiXBundleBuilder``, which can be used to generate an
6262
``.exe`` installer for the application.
6363

64+
Other Relevant Changes
65+
^^^^^^^^^^^^^^^^^^^^^^
66+
67+
* CI has been moved from Azure Pipelines to GitHub Actions.
68+
6469
.. _version_0_10_3:
6570

6671
0.10.3

pyoxidizer/build.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,16 @@ fn canonicalize_path(path: &Path) -> Result<PathBuf, std::io::Error> {
3535
fn find_root_git_commit(commit: Commit) -> Commit {
3636
let mut current = commit;
3737

38-
while let Ok(parent) = current.parent(0) {
39-
current = parent;
38+
loop {
39+
match current.parent(0) {
40+
Ok(parent) => {
41+
current = parent;
42+
}
43+
Err(e) => {
44+
println!("parent error: {:?}", e);
45+
break;
46+
}
47+
}
4048
}
4149

4250
current
@@ -68,9 +76,13 @@ fn main() {
6876
// This isn't reliable, especially on Windows. So we use libgit2 to extract data
6977
// from the git repo, if present.
7078
if let Ok(repo) = Repository::discover(&cwd) {
79+
println!("discovered repo at {}", repo.path().display());
7180
if let Ok(head_ref) = repo.head() {
81+
println!("head ref: {}", head_ref.name().unwrap());
7282
if let Ok(commit) = head_ref.peel_to_commit() {
83+
println!("commit: {}", commit.id().to_string());
7384
let root = find_root_git_commit(commit.clone());
85+
println!("root commit: {}", root.id().to_string());
7486

7587
if root.id().to_string() == ROOT_COMMIT {
7688
let path = canonicalize_path(repo.workdir().expect("could not obtain workdir"))
@@ -83,6 +95,8 @@ fn main() {
8395
}
8496
}
8597

98+
panic!("done with repo discovery");
99+
86100
if force_git_source {
87101
repo_path = "".to_string();
88102
}

0 commit comments

Comments
 (0)