Skip to content

Commit

Permalink
Merge pull request #3 from fluent-ci-templates/fix/codecov-token
Browse files Browse the repository at this point in the history
fix: add codecov token
  • Loading branch information
tsirysndr authored Aug 20, 2023
2 parents 33d9b0a + 33dc222 commit 4da6c53
Show file tree
Hide file tree
Showing 12 changed files with 220 additions and 29 deletions.
14 changes: 7 additions & 7 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions fixtures/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ steps:
displayName: Setup Dagger
- script: dagger run fluentci codecov_pipeline
displayName: Upload Coverage
variables:
CODECOV_TOKEN: $(CODECOV_TOKEN)
3 changes: 3 additions & 0 deletions fixtures/buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ phases:
post_build:
commands:
- echo Build completed on `date`
env:
secrets-manager:
CODECOV_TOKEN: codecov:CODECOV_TOKEN
2 changes: 2 additions & 0 deletions fixtures/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
command: dagger run fluentci codecov_pipeline
machine:
image: ubuntu-2004:2023.07.1
environment:
CODECOV_TOKEN: ${{codecov.CODECOV_TOKEN}}
workflows:
dagger:
jobs:
Expand Down
4 changes: 2 additions & 2 deletions import_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"@dagger.io/dagger": "https://esm.sh/v128/*@dagger.io/dagger@0.8.1",
"fluent_gitlab_ci": "https://deno.land/x/fluent_gitlab_ci@v0.3.2/mod.ts",
"fluent_github_actions": "https://deno.land/x/fluent_github_actions@v0.2.1/mod.ts",
"fluent_circleci": "https://deno.land/x/fluent_circleci@v0.2.4/mod.ts",
"fluent_azure_pipelines": "https://deno.land/x/fluent_azure_pipelines@v0.1.5/mod.ts",
"fluent_circleci": "https://deno.land/x/fluent_circleci@v0.2.5/mod.ts",
"fluent_azure_pipelines": "https://deno.land/x/fluent_azure_pipelines@v0.2.0/mod.ts",
"fluent_aws_codepipeline": "https://deno.land/x/fluent_aws_codepipeline@v0.2.3/mod.ts",
"url": "node:url",
"readline": "node:readline",
Expand Down
39 changes: 39 additions & 0 deletions src/aws/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# AWS CodePipeline

![deno compatibility](https://shield.deno.dev/deno/^1.34)

The following command will generate a `buildspec.yml` file in your project:

```bash
fluentci ac init
```

Generated file:

```yaml
# Do not edit this file directly. It is generated by https://deno.land/x/fluent_aws_codepipeline

version: 0.2
phases:
install:
commands:
- curl -fsSL https://deno.land/x/install/install.sh | sh
- export DENO_INSTALL="$HOME/.deno"
- export PATH="$DENO_INSTALL/bin:$PATH"
- deno install -A -r https://cli.fluentci.io -n fluentci
- curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.1 sh
- mv bin/dagger /usr/local/bin
- dagger version
build:
commands:
- dagger run fluentci codecov_pipeline
post_build:
commands:
- echo Build completed on `date`
env:
secrets-manager:
CODECOV_TOKEN: codecov:CODECOV_TOKEN

```

Feel free to edit the template generator at `.fluentci/src/aws/config.ts` to your needs.
5 changes: 5 additions & 0 deletions src/aws/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import { BuildSpec } from "fluent_aws_codepipeline";
export function generateYaml(): BuildSpec {
const buildspec = new BuildSpec();
buildspec
.env({
"secrets-manager": {
CODECOV_TOKEN: "codecov:CODECOV_TOKEN",
},
})
.phase("install", {
commands: [
"curl -fsSL https://deno.land/x/install/install.sh | sh",
Expand Down
41 changes: 41 additions & 0 deletions src/azure/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Azure Pipelines

![deno compatibility](https://shield.deno.dev/deno/^1.34)

The following command will generate a `azure-pipelines.yml` file in your project:

```bash
fluentci ap init
```

Generated file:

```yaml
# Do not edit this file directly. It is generated by https://deno.land/x/fluent_azure_pipelines

trigger:
- master
pool:
name: Default
vmImage: ubuntu-latest
steps:
- script: |
curl -fsSL https://deno.land/x/install/install.sh | sh
export DENO_INSTALL="$HOME/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
displayName: Install Deno
- script: deno install -A -r https://cli.fluentci.io -n fluentci
displayName: Setup Fluent CI CLI
- script: |
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.1 sh
sudo mv bin/dagger /usr/local/bin
dagger version
displayName: Setup Dagger
- script: dagger run fluentci codecov_pipeline
displayName: Upload Coverage
variables:
CODECOV_TOKEN: $(CODECOV_TOKEN)

```

Feel free to edit the template generator at `.fluentci/src/azure/config.ts` to your needs.
3 changes: 3 additions & 0 deletions src/azure/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export function generateYaml(): AzurePipeline {
name: "Default",
vmImage: "ubuntu-latest",
})
.variables({
CODECOV_TOKEN: "$(CODECOV_TOKEN)",
})
.step({
script: installDeno,
displayName: "Install Deno",
Expand Down
46 changes: 46 additions & 0 deletions src/circleci/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Circle CI

![deno compatibility](https://shield.deno.dev/deno/^1.34)


The following command will generate a `.circleci/config.yml` file in your project:

```bash
fluentci cci init
```

Generated file:

```yaml
# Do not edit this file directly. It is generated by https://deno.land/x/fluent_circleci

version: 2.1
jobs:
codecov:
steps:
- checkout
- run: sudo apt-get update && sudo apt-get install -y curl unzip
- run: |
curl -fsSL https://deno.land/x/install/install.sh | sh
export DENO_INSTALL="$HOME/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
- run: deno install -A -r https://cli.fluentci.io -n fluentci
- run: |
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.1 sh
sudo mv bin/dagger /usr/local/bin
dagger version
- run:
name: Upload Coverage
command: dagger run fluentci codecov_pipeline
machine:
image: ubuntu-2004:2023.07.1
environment:
CODECOV_TOKEN: ${{codecov.CODECOV_TOKEN}}
workflows:
dagger:
jobs:
- codecov

```

Feel free to edit the template generator at `.fluentci/src/circleci/config.ts` to your needs.
45 changes: 25 additions & 20 deletions src/circleci/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,38 @@ import { CircleCI, Job } from "fluent_circleci";
export function generateYaml(): CircleCI {
const circleci = new CircleCI();

const codecov = new Job().machine({ image: "ubuntu-2004:2023.07.1" }).steps([
"checkout",
{
run: "sudo apt-get update && sudo apt-get install -y curl unzip",
},
{
run: `\
const codecov = new Job()
.machine({ image: "ubuntu-2004:2023.07.1" })
.variables({
CODECOV_TOKEN: "${{codecov.CODECOV_TOKEN}}",
})
.steps([
"checkout",
{
run: "sudo apt-get update && sudo apt-get install -y curl unzip",
},
{
run: `\
curl -fsSL https://deno.land/x/install/install.sh | sh
export DENO_INSTALL="$HOME/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"`,
},
{
run: "deno install -A -r https://cli.fluentci.io -n fluentci",
},
{
run: `\
},
{
run: "deno install -A -r https://cli.fluentci.io -n fluentci",
},
{
run: `\
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.1 sh
sudo mv bin/dagger /usr/local/bin
dagger version`,
},
{
run: {
name: "Upload Coverage",
command: "dagger run fluentci codecov_pipeline",
},
},
]);
{
run: {
name: "Upload Coverage",
command: "dagger run fluentci codecov_pipeline",
},
},
]);

circleci.jobs({ codecov }).workflow("dagger", ["codecov"]);

Expand Down
45 changes: 45 additions & 0 deletions src/gitlab/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Gitlab CI

![deno compatibility](https://shield.deno.dev/deno/^1.34)

The following command will generate a `.gitlab-ci.yml` file in your project:

```bash
fluentci gl init
```

Generated file:

```yaml

# Do not edit this file directly. It is generated by Fluent GitLab CI

.docker:
image: denoland/deno:alpine
services:
- docker:${DOCKER_VERSION}-dind
variables:
DOCKER_HOST: tcp://docker:2376
DOCKER_TLS_VERIFY: "1"
DOCKER_TLS_CERTDIR: /certs
DOCKER_CERT_PATH: /certs/client
DOCKER_DRIVER: overlay2
DOCKER_VERSION: 20.10.16

.dagger:
extends: .docker
before_script:
- apk add docker-cli curl unzip
- deno install -A -r https://cli.fluentci.io -n fluentci
- curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.1 sh
- mv bin/dagger /usr/local/bin
- dagger version

codecov:
extends: .dagger
script:
- dagger run fluentci codecov_pipeline

```

Feel free to edit the template generator at `.fluentci/src/gitlab/config.ts` to your needs.

0 comments on commit 4da6c53

Please sign in to comment.