-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add Nix to CI #36
Add Nix to CI #36
Changes from all commits
e1534d6
1878ce1
80726df
ce8c083
49217f3
715e206
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Test Nix | ||
|
||
on: | ||
push: | ||
branches: | ||
- "**" | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: | ||
- os: darwin | ||
cpu: x86_64 | ||
base: macos-13 # always x86_64-darwin | ||
nix-installer: | ||
platform: x86_64-darwin | ||
- os: darwin | ||
cpu: arm64 | ||
base: macos-14 # always arm64-darwin | ||
nix-installer: | ||
platform: aarch64-darwin | ||
- os: linux | ||
cpu: x86_64 | ||
base: ubuntu-24.04 # always x86_64-linux-gnu | ||
nix-installer: | ||
platform: x86_64-linux | ||
- os: linux | ||
cpu: aarch64 | ||
base: arm-4core-linux-ubuntu24.04 # always aarch64-linux-gnu | ||
nix-installer: | ||
platform: aarch64-linux | ||
|
||
name: Test Nix (${{ matrix.platform.cpu }}-${{ matrix.platform.os }}) | ||
runs-on: ${{ matrix.platform.base }} | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
steps: | ||
- name: Check CPU arch | ||
run: | | ||
test "$(uname -m)" = "${{ matrix.platform.cpu }}" | ||
- uses: actions/checkout@v4 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 Code VulnerabilityWorkflow depends on a GitHub actions pinned by tag (...read more)When using a third party action, one needs to provide its GitHub path ( No pinned Git ref means the action uses the latest commit of the default branch each time it runs, eventually running newer versions of the code that were not audited by Datadog. Specifying a Git tag is better, but since they are not immutable, using a full length hash is recommended to make sure the action content is actually frozen to some reviewed state. Be careful however, as even pinning an action by hash can be circumvented by attackers still. For instance, if an action relies on a Docker image which is itself not pinned to a digest, it becomes possible to alter its behaviour through the Docker image without actually changing its hash. You can learn more about this kind of attacks in Unpinnable Actions: How Malicious Code Can Sneak into Your GitHub Actions Workflows. Pinning actions by hash is still a good first line of defense against supply chain attacks. Additionally, pinning by hash or tag means the action won’t benefit from newer version updates if any, including eventual security patches. Make sure to regularly check if newer versions for an action you use are available. For actions coming from a very trustworthy source, it can make sense to use a laxer pinning policy to benefit from updates as soon as possible. |
||
with: | ||
persist-credentials: false | ||
- uses: DeterminateSystems/nix-installer-action@e50d5f73bfe71c2dd0aa4218de8f4afa59f8f81d | ||
with: | ||
source-url: https://github.com/DeterminateSystems/nix-installer/releases/download/v0.30.0/nix-installer-${{ matrix.platform.nix-installer.platform }} | ||
- uses: DeterminateSystems/magic-nix-cache-action@87b14cf437d03d37989d87f0fa5ce4f5dc1a330b | ||
- name: Print Nix version | ||
run: | | ||
nix --version | ||
- name: Print ruby version | ||
run: | | ||
nix develop --command which ruby | ||
nix develop --command ruby --version | ||
- name: Bundle install | ||
run: nix develop --command bundle install | ||
- name: Run tests | ||
run: nix develop --command bundle exec rake docker:list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟠 Code Vulnerability
No explicit permissions set for at the workflow level (...read more)
Datadog’s GitHub organization defines default permissions for the
GITHUB_TOKEN
to be restricted (contents:read
,metadata:read
, andpackages:read
).Your repository may require a different setup, so consider defining permissions for each job following the least privilege principle to restrict the impact of a possible compromise.
You can find the list of all possible permissions in Workflow syntax for GitHub Actions - GitHub Docs. They can be defined at the job or the workflow level.