Skip to content

Commit

Permalink
Refactor build
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-noland committed Nov 14, 2024
1 parent 4e51ada commit bbe47fd
Show file tree
Hide file tree
Showing 10 changed files with 134 additions and 313 deletions.
49 changes: 0 additions & 49 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,30 +151,6 @@ jobs:
body: body
});
- name: "outdated packages (musl64)"
uses: "actions/github-script@v7"
if: ${{ github.event_name == 'pull_request' }}
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
let fs = require('fs');
let body = "<details>\n";
body += "<summary>\n\n";
body = "## Outdated packages (musl64):\n";
body += "</summary>\n\n";
body += fs.readFileSync('/tmp/dpdk-sys/builds/env.sysroot.musl64.outdated.md');
body += "\n</details>\n";
const maxLength = 65535;
if (body.length > maxLength) {
const warning = "\n...output truncated due to length limits...\n";
body = body.slice(0, maxLength - warning.length) + warning;
}
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
});
- name: "Vulnerable packages (gnu64)"
uses: "actions/github-script@v7"
Expand All @@ -201,31 +177,6 @@ jobs:
body: body
});
- name: "Vulnerable packages (musl64)"
uses: "actions/github-script@v7"
if: ${{ github.event_name == 'pull_request' }}
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
let fs = require('fs');
let body = "<details>\n";
body += "<summary>\n\n";
body = "## Vulnerable packages (musl64):\n";
body += "</summary>\n\n";
body += fs.readFileSync('/tmp/dpdk-sys/builds/env.sysroot.musl64.vulns.triage.md');
body += "\n</details>\n";
const maxLength = 65535;
if (body.length > maxLength) {
const warning = "\n...output truncated due to length limits...\n";
body = body.slice(0, maxLength - warning.length) + warning;
}
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
});
- name: "Setup tmate session for debug"
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
uses: "mxschmitt/action-tmate@v3"
Expand Down
25 changes: 2 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,2 @@
ARG TAG="latest"
FROM ghcr.io/githedgehog/dpdk-sys/compile-env:${TAG} AS compile-env
FROM ghcr.io/githedgehog/dpdk-sys/doc-env:${TAG} AS doc-env
FROM ghcr.io/githedgehog/dpdk-sys/dev-env:${TAG} AS dev-env
SHELL ["/bin/bash", "-euxo", "pipefail", "-c"]

# I can't properly set permissions in nix because of the way it works.
# So I have to do this hacky thing to get sudo to work.
# Also, ldconfig breaks in nix settings.
# Normally that doesn't matter but it is called by vscode in the dev container
# so we need to remove it to make that work.
RUN chmod 777 /tmp \
&& chmod 4755 /sbin/sudo \
&& chmod 555 /etc/pam.d \
&& chmod -R 444 /etc/pam.d/* \
&& chmod 444 /etc/group \
&& chmod 444 /etc/passwd \
&& rm /bin/ldconfig \
&& mkdir -p /home/runner \
&& chown -R runner:runner /home/runner

USER runner
CMD ["/bin/bash", "--login"]
ARG IMAGE=scratch
FROM ${IMAGE}
1 change: 0 additions & 1 deletion builds.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ matrix:
- "debug"
target:
- "x86_64-unknown-linux-gnu"
- "x86_64-unknown-linux-musl"
just: *just_version
nixpkgs:
- *nixpkgs_unstable
1 change: 0 additions & 1 deletion builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ matrix:
- "debug"
target:
- "x86_64-unknown-linux-gnu"
- "x86_64-unknown-linux-musl"
just: *just_version
nixpkgs:
- *nixpkgs_unstable
Loading

0 comments on commit bbe47fd

Please sign in to comment.