Skip to content
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

Replace CircleCI with GitHub actions #1702

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ insert_final_newline = true
[{package.json,yarn.lock}]
indent_size = 2

[generators/*/templates/circleci.yaml.ejs]
[generators/*/templates/workflow.yaml.ejs]
indent_size = 2

[generators/*/templates/ansible/**/*.yaml.ejs]
Expand Down
50 changes: 0 additions & 50 deletions generators/app/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import fs from 'fs';
import path from 'path';
import YAML from 'yaml';
import helpers from 'yeoman-test';
import * as CircleCI from '../../utils/circleci';

describe('When running the generator with React', () => {
let root: string;
Expand Down Expand Up @@ -33,16 +32,6 @@ describe('When running the generator with React', () => {

expect(config.devDependencies.vite).toBeDefined();
});

test('It add the right dependencies to the deploy job', async () => {
const content = await fs.promises.readFile(path.resolve(root, '.circleci', 'config.yml'), 'utf8');
const config = CircleCI.Config.fromRaw(YAML.parse(content));

expect(config.workflows.build?.jobs.deploy?.requires).toEqual([
'backend-archive',
'frontend-archive',
]);
});
});

describe('When running the generator with Next.js', () => {
Expand Down Expand Up @@ -74,45 +63,6 @@ describe('When running the generator with Next.js', () => {

expect(config.dependencies.next).toBeDefined();
});

test('It add the right dependencies to the deploy job', async () => {
const content = await fs.promises.readFile(path.resolve(root, '.circleci', 'config.yml'), 'utf8');
const config = CircleCI.Config.fromRaw(YAML.parse(content));

expect(config.workflows.build?.jobs.deploy?.requires).toEqual([
'backend-archive',
'frontend-archive',
]);
});
});

describe('When running the generator with Symfony', () => {
let root: string;

beforeAll(async () => {
const result = await helpers.run(__dirname)
.withPrompts({
backend: 'symfony',
contactEmail: 'test@example.com',
add: false,
twig: true,
});

root = result.cwd;
});

afterAll(async () => {
await fs.promises.rm(root, { recursive: true });
});

test('It add the right dependencies to the deploy job', async () => {
const content = await fs.promises.readFile(path.resolve(root, '.circleci', 'config.yml'), 'utf8');
const config = CircleCI.Config.fromRaw(YAML.parse(content));

expect(config.workflows.build?.jobs.deploy?.requires).toEqual([
'backend-build',
]);
});
});

describe('When running the generator with Flutter', () => {
Expand Down
7 changes: 0 additions & 7 deletions generators/express/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import path from 'path';
import execa from 'execa';
import YAML from 'yaml';
import helpers from 'yeoman-test';
import { Config } from '../../utils/circleci';

describe('When running the generator', () => {
let root: string;
Expand Down Expand Up @@ -90,12 +89,6 @@ describe('When running the generator with kubernetes deployment', () => {
await fs.promises.rm(root, { recursive: true });
});

test('It generates a valid CircleCI config', async () => {
const content = await fs.promises.readFile(path.join(root, '.circleci', 'config.yml'), 'utf8');

Config.fromRaw(YAML.parse(content));
});

test('It generates a valid terraform config', async () => {
const cwd = path.join(root, 'environments', 'staging');

Expand Down
6 changes: 1 addition & 5 deletions generators/express/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

this.configureDockerCompose('docker-compose.yaml.ejs');

this.configureCircleCI('circleci.yaml.ejs');
this.renderTemplate('workflow.yaml.ejs', `.github/workflows/${packageName}.yaml`);

switch (this.config.get('deployment')) {
case DeploymentChoice.Ansible:
Expand All @@ -32,10 +32,6 @@
encrypt: createEncrypt(this.readDestination('ansible/vault_pass.txt').trim()),
cookieSecret: cryptoRandomString({ length: 64, type: 'alphanumeric' }),
});

this.updateCircleCIConfig((config) => {
config.workflows.build!.jobs.deploy!.requires.push(`${packageName}-archive`);
});
break;
case DeploymentChoice.Kubernetes: {
const packageVar = varName(packageName);
Expand Down Expand Up @@ -74,7 +70,7 @@
}
`);

this.writeReleaseVariable(`${packageVar}.image.digest`, `data.docker_registry_image.${packageVar}.sha256_digest`);

Check warning on line 73 in generators/express/index.ts

View workflow job for this annotation

GitHub Actions / lint

This line has a length of 130. Maximum allowed is 120
this.writeReleaseVariable(`${packageVar}.sentry.dsn`, `var.${packageVar}_sentry_dsn`);

this.appendDestination('modules/deployment/release.tf', indent`
Expand All @@ -83,7 +79,7 @@
length = 32
}
`);
this.writeReleaseVariable(`${packageVar}.cookie.secret`, `random_password.${packageVar}_cookie_secret.result`);

Check warning on line 82 in generators/express/index.ts

View workflow job for this annotation

GitHub Actions / lint

This line has a length of 127. Maximum allowed is 120
break;
}
}
Expand Down
186 changes: 0 additions & 186 deletions generators/express/templates/circleci.yaml.ejs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
---
- import_role:
name: build
name: find_github_artifact
vars:
job_name: <%= packageName %>-archive
repository_name: <%= repositoryName %>
workflow_name: <%= packageName %>
delegate_to: localhost
when: artifact_url is not defined
- import_role:
name: deploy
name: deploy_artifact
environment: '{{ <%= varName(packageName) %>_env }}'
vars:
path: /home/<%= packageName %>
artifact_path: <%= packageName %>.tar.gz
job_name: <%= packageName %>-archive
repository_name: <%= repositoryName %>
before_finalize:
- ./node_modules/.bin/typeorm --dataSource dist/infrastructure/database/data-source.js migration:run
after_finalize:
Expand Down

This file was deleted.

Loading
Loading