-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
5,026 additions
and
31 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules | ||
result |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: docker-deploy | ||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- '**' | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set ENV variables | ||
run: | | ||
echo "REGISTRY=ghcr.io" >> $GITHUB_ENV | ||
echo "REPO_OWNER=$(echo ${GITHUB_REPOSITORY%/*})" >> $GITHUB_ENV | ||
echo "REPO_NAME=$(echo ${GITHUB_REPOSITORY#*/})" >> $GITHUB_ENV | ||
echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV | ||
echo "DOCKER_TAG=$(echo ${GITHUB_REPOSITORY#*/}):$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV | ||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
with: | ||
install: true | ||
- name: Login to GitHub Container Registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ${{env.REGISTRY}} | ||
username: ${{env.REPO_OWNER}} | ||
password: ${{secrets.CR_PAT}} | ||
- name: Build and push | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: ${{env.REGISTRY}}/${{env.REPO_OWNER}}/${{env.DOCKER_TAG}} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
- name: Execute tests | ||
run: docker run -t --entrypoint="npm" ${REGISTRY}/${REPO_OWNER}/${DOCKER_TAG} run test |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,14 @@ | ||
name: docker-based-ci | ||
name: nix-based-ci | ||
on: push | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set ENV variables | ||
run: | | ||
echo "REGISTRY=ghcr.io" >> $GITHUB_ENV | ||
echo "REPO_OWNER=$(echo ${GITHUB_REPOSITORY%/*})" >> $GITHUB_ENV | ||
echo "REPO_NAME=$(echo ${GITHUB_REPOSITORY#*/})" >> $GITHUB_ENV | ||
echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV | ||
echo "DOCKER_TAG=$(echo ${GITHUB_REPOSITORY#*/}):$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV | ||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
with: | ||
install: true | ||
- name: Login to GitHub Container Registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ${{env.REGISTRY}} | ||
username: ${{env.REPO_OWNER}} | ||
password: ${{secrets.CR_PAT}} | ||
- name: Build and push | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: ${{env.REGISTRY}}/${{env.REPO_OWNER}}/${{env.DOCKER_TAG}} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
- name: Execute tests | ||
run: docker run -t --entrypoint="npm" ${REGISTRY}/${REPO_OWNER}/${DOCKER_TAG} run test | ||
- uses: DeterminateSystems/nix-installer-action@main | ||
- uses: DeterminateSystems/magic-nix-cache-action@main | ||
- name: Run npm install & build | ||
run: nix develop --command npm install && npm run build | ||
- name: Run tests | ||
run: nix develop --command npm run test |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
node_modules | ||
result | ||
tmp | ||
test-output.log | ||
deno-bridge.js |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
TODO | ||
test | ||
result | ||
dist | ||
docs | ||
tmp | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
description = "A flake for qunitx npm package"; | ||
|
||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
inputs.napalm.url = "github:nix-community/napalm"; | ||
|
||
# NOTE: This is optional, but is how to configure napalm's env | ||
inputs.napalm.inputs.nixpkgs.follows = "nixpkgs"; | ||
|
||
outputs = { self, nixpkgs, napalm }: | ||
let | ||
system = "x86_64-linux"; | ||
pkgs = nixpkgs.legacyPackages."${system}"; | ||
in { | ||
packages."${system}".default = napalm.legacyPackages."${system}".buildPackage ./. { | ||
nodejs = pkgs.nodejs_20; | ||
PUPPETEER_SKIP_DOWNLOAD=1; | ||
}; | ||
|
||
devShells."${system}".default = pkgs.mkShell { | ||
nativeBuildInputs = with pkgs; [ | ||
deno | ||
nodejs_20 | ||
]; | ||
}; | ||
}; | ||
} |
Oops, something went wrong.